QGraphicsSceneWheelEvent类
The QGraphicsSceneWheelEvent class provides wheel events in the graphics view framework. 更多...
| 头文件 | #include <QGraphicsSceneWheelEvent> | 
| CMake | find_package(Qt6 REQUIRED COMPONENTS Widgets) target_link_libraries(mytarget PRIVATE Qt6::Widgets) | 
| qmake | QT += widgets | 
| 继承自 | QGraphicsSceneEvent | 
公共函数
| 虚拟 | ~QGraphicsSceneWheelEvent() | 
| Qt::MouseButtons | buttons() const | 
| int | delta() const | 
| (since 6.2)bool | isInverted() const | 
| Qt::KeyboardModifiers | modifiers() const | 
| Qt::Orientation | orientation() const | 
| (since 6.2)Qt::ScrollPhase | phase() const | 
| (since 6.2)QPoint | pixelDelta() const | 
| QPointF | pos() const | 
| QPointF | scenePos() const | 
| QPoint | screenPos() const | 
详细描述
QWheelEvent通过QGraphicsView接收到的都会转换为QGraphicsSceneWheelEvent;它将QWheelEvent::globalPos()转换为项、场景和屏幕坐标(pos()、scenePos()和screenPos())。
另请参阅QGraphicsSceneMouseEvent、QGraphicsSceneContextMenuEvent、QGraphicsSceneHoverEvent和QWheelEvent。
成员函数文档
[虚拟 noexcept] QGraphicsSceneWheelEvent::~QGraphicsSceneWheelEvent()
销毁QGraphicsSceneWheelEvent。
Qt::MouseButtons QGraphicsSceneWheelEvent::buttons() const
返回在wheel事件发生时按下的鼠标按钮。
另请参阅modifiers().
int QGraphicsSceneWheelEvent::delta() const
返回鼠标滚轮旋转的距离,单位为度八分之一(1/8s)。正值表示滚轮前进,远离用户;负值表示滚轮后退,朝向用户。
大多数鼠标类型以15度为单位工作,此时delta值是120(== 15 * 8)的倍数。
[自6.2以来] bool QGraphicsSceneWheelEvent::isInverted() const
返回传递给事件的delta值是否被反转。
此功能从Qt 6.2版开始引入。
Qt::KeyboardModifiers QGraphicsSceneWheelEvent::modifiers() const
返回在发生滚轮事件时激活的键盘修饰符。
另请参阅buttons ()。
Qt::Orientation QGraphicsSceneWheelEvent::orientation() const
返回滚轮的方向。
[自6.2以来] Qt::ScrollPhase QGraphicsSceneWheelEvent::phase() const
返回此滚轮事件的滚动阶段。
此功能从Qt 6.2版开始引入。
另请参阅QWheelEvent::phase。
[自6.2以来] QPoint QGraphicsSceneWheelEvent::pixelDelta() const
返回屏幕上滚动距离的像素值。该值在支持高分辨率基于像素的增量值(如macOS)的平台上提供。该值应直接用于在屏幕上滚动内容。
此功能从Qt 6.2版开始引入。
QPointF QGraphicsSceneWheelEvent::pos() const
返回在发生滚轮事件时,光标在项坐标系中的位置。
另请参阅scenePos () 和 screenPos ()。
QPointF QGraphicsSceneWheelEvent::scenePos() const
返回在发生滚轮事件时,光标在场景坐标系中的位置。
QPoint QGraphicsSceneWheelEvent::screenPos() const
返回在发生滚轮事件时,光标在屏幕坐标系中的位置。
© 2024 Qt公司有限公司。包含在此处的文档贡献为各自所有者的版权。提供的文档符合自由软件基金会发布并在GNU自由文档许可版本1.3条款。Qt及其商标是芬兰的Qt公司及其它全球国家的商标。所有其他商标均为其各自所有者财产。