PDA

View Full Version : How to track scrolling



Slewman
15th February 2010, 20:26
Is there a scroll event or something similar that will tell me how much my widget has been scrolled?

What i have right now is I am drawing a box over a QTableWidget and i want to be able to move this box up/down with the table widget when the table widget is scrolled up/down.

Im sure there is something somewhere in Qt to get this data i just cant seem to find it.

ChrisW67
15th February 2010, 23:45
The QAbstractSlider::valueChanged() signal from the relevant scroll bar is what you are after. Look at the Frozen Column example (http://doc.trolltech.com/4.6/itemviews-frozencolumn.html) for something quite similar; it synchronises two sliders and also adjusts an overlaid widget.