QGraphicsSceneWheelEvent 类

QGraphicsSceneWheelEvent 类提供在图形视图框架中的滚轮事件。 更多...

头: #include <QGraphicsSceneWheelEvent>
CMake: find_package(Qt6 COMPONENTS Widgets REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::Widgets)
qmake: QT += widgets
继承: QGraphicsSceneEvent

公共函数

virtual ~QGraphicsSceneWheelEvent ()
Qt::MouseButtons buttons () const
int delta () const
bool isInverted () const
Qt::KeyboardModifiers modifiers () const
Qt::Orientation orientation () const
Qt::ScrollPhase phase () const
QPoint pixelDelta () const
QPointF pos () const
QPointF scenePos () const
QPoint screenPos () const

详细描述

QWheelEvent 接收通过 QGraphicsView are translated into QGraphicsSceneWheelEvents; it translates the QWheelEvent::globalPos() into item, scene, and screen coordinates ( pos (), scenePos (),和 screenPos ()).

另请参阅 QGraphicsSceneMouseEvent , QGraphicsSceneContextMenuEvent , QGraphicsSceneHoverEvent ,和 QWheelEvent .

成员函数文档编制

[虚拟] QGraphicsSceneWheelEvent:: ~QGraphicsSceneWheelEvent ()

销毁 QGraphicsSceneWheelEvent .

Qt::MouseButtons QGraphicsSceneWheelEvent:: buttons () const

Returns the mouse buttons that were pressed when the wheel event occurred.

另请参阅 modifiers ().

int QGraphicsSceneWheelEvent:: delta () const

Returns the distance that the wheel is rotated, in eighths (1/8s) of a degree. A positive value indicates that the wheel was rotated forwards away from the user; a negative value indicates that the wheel was rotated backwards toward the user.

Most mouse types work in steps of 15 degrees, in which case the delta value is a multiple of 120 (== 15 * 8).

[since 6.2] bool QGraphicsSceneWheelEvent:: isInverted () const

返回随事件交付的增量值是否反转。

该函数在 Qt 6.2 引入。

Qt::KeyboardModifiers QGraphicsSceneWheelEvent:: modifiers () const

Returns the keyboard modifiers that were active when the wheel event occurred.

另请参阅 buttons ().

Qt::Orientation QGraphicsSceneWheelEvent:: orientation () const

返回滚轮取向。

[since 6.2] Qt::ScrollPhase QGraphicsSceneWheelEvent:: phase () const

返回此滚轮事件的卷动阶段。

该函数在 Qt 6.2 引入。

另请参阅 QWheelEvent::phase .

[since 6.2] QPoint QGraphicsSceneWheelEvent:: pixelDelta () const

返回以屏幕像素为单位的卷动距离。此值由支持基于高分辨率像素的增量值的平台 (譬如 macOS) 提供。应该将值直接用于卷动屏幕内容。

该函数在 Qt 6.2 引入。

另请参阅 QWheelEvent::pixelDelta .

QPointF QGraphicsSceneWheelEvent:: pos () const

Returns the position of the cursor in item coordinates when the wheel event occurred.

另请参阅 scenePos () 和 screenPos ().

QPointF QGraphicsSceneWheelEvent:: scenePos () const

Returns the position of the cursor in scene coordinates when the wheel event occurred.

另请参阅 pos () 和 screenPos ().

QPoint QGraphicsSceneWheelEvent:: screenPos () const

Returns the position of the cursor in screen coordinates when the wheel event occurred.

另请参阅 pos () 和 scenePos ().