开发者

A scrollbar event when scrolling?

开发者 https://www.devze.com 2023-03-27 21:33 出处:网络
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 c

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号