A scrollbar event when scrolling?
I need an event for detecting if an user has moved the scrollbar position to another one.
In other words, if the user does scroll up/down, would it be possible to catch a开发者_如何学Go signal so I can know the scroll has been changed its position?
I think it's not important, but the scrollbar I refer to is inside a QGraphicsView
.
Regards.
Edit:
QGraphicsView
is for displaying items in the screen, and if those items are too big it shows the scrollbars I refer to. What I need is to know when the user changes the position of those scrollbars.
Sliders have a sliderMoved(int value)
signal, where value is the new position of slider.
If you need to get notified when the scroll bar position is changed, you need to subclass the QGraphicsView
and reimplement the QWidget::mouseMoveEvent(QMouseEvent*)
. For this you also need to enable mouse tracking. Here is Qt 4.7 QGraphicsView reference.
精彩评论