滚动时的滚动条事件?

发布于 2024-11-29 10:31:50 字数 265 浏览 1 评论 0原文

我需要一个事件来检测用户是否将滚动条位置移动到另一个位置。

换句话说,如果用户确实向上/向下滚动,是否可以捕获信号以便我知道滚动已更改其位置?

我认为这并不重要,但我引用的滚动条位于 QGraphicsView 内部。

问候。

编辑:

QGraphicsView 用于在屏幕中显示项目,如果这些项目太大,它会显示我引用的滚动条。我需要的是知道用户何时更改这些滚动条的位置。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

谁把谁当真 2024-12-06 10:31:50

滑块有一个 sliderMoved(int value) 信号,其中 value 是滑块的新位置。

Sliders have a sliderMoved(int value) signal, where value is the new position of slider.

情泪▽动烟 2024-12-06 10:31:50

如果您需要在滚动条位置更改时收到通知,则需要子类化QGraphicsView并重新实现QWidget::mouseMoveEvent(QMouseEvent*)。为此,您还需要启用鼠标跟踪。 这里是 Qt 4.7 QGraphicsView 参考。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文