Reputation: 189
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 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.
Upvotes: 10
Views: 5075
Reputation: 359
Sliders have a sliderMoved(int value)
signal, where value is the new position of slider.
Upvotes: 7
Reputation: 1022
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.
Upvotes: 0