QTableWidget scroll one item down.
General and Desktop
5
Posts
2
Posters
9.9k
Views
1
Watching
-
Hello Qt devs!
I have a QTableWidget which contains several rows (holding simple QStrings with information to the user). I am implementing two buttons, which I would like to have the same functionality as the arrow buttons in the scrollbar. The table should not have focus.
Can this be done?
Thank you for your time!
-
Sure, just call setValue() on the QTableWidget's verticalScrollBar(). For scrolling by exactly one item you may also want to call setVerticalScrollMode(QAbstractItemView::ScrollPerItem).
And now I'm not sure if the view smart enough to handle that automatically when scrolling programmatically or you have to scroll by a row's height in pixels...