QGraphicsSceneWheelEvent 類

QGraphicsSceneWheelEvent 類提供在圖形視圖框架中的滾輪事件。 更多...

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

公共函數

virtual ~QGraphicsSceneWheelEvent ()
Qt::MouseButtons buttons () const
int delta () const
(從 6.2 起) bool isInverted () const
Qt::KeyboardModifiers modifiers () const
Qt::Orientation orientation () const
(從 6.2 起) Qt::ScrollPhase phase () const
(從 6.2 起) 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 .

成員函數文檔編製

[virtual noexcept] 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 ().