Frage

I have a QListView that displays square-shaped items. My problem is that when I scroll this list, it scrolls one entire row of squares at a time, and I think that doesn't look right. Instead, I would like the list to scroll 1 pixels or two at a time - i.e. smoothly. It's mostly a cosmetic change. Any idea how I would do that?

War es hilfreich?

Lösung

Ok I just found there's a property for that:

listView->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);

The other option, the default, is ScrollPerItem.

Andere Tipps

Tried your solution and it didn't work for me. But it worked well when i added:

listView -> verticalScrollBar() -> setSingleStep(5);

Or something like that, sorry for mistakes if there are any, i'm writing in PyQt5:

listView.verticalScrollBar().setSingleStep(5)

Edit: oh, i haven't noticed the year of this answer...

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top