QGraphicsSceneWheelEvent Class
The QGraphicsSceneWheelEvent class provides wheel events in the graphics view framework. More...
| Header: | #include <QGraphicsSceneWheelEvent> | 
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Widgets)target_link_libraries(mytarget PRIVATE Qt6::Widgets) | 
| qmake: | QT += widgets | 
| Inherits: | QGraphicsSceneEvent | 
Public Functions
| virtual | ~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 | 
Detailed Description
QWheelEvents received by a QGraphicsView are translated into QGraphicsSceneWheelEvents; it translates the QWheelEvent::globalPos() into item, scene, and screen coordinates (pos(), scenePos(), and screenPos()).
See also QGraphicsSceneMouseEvent, QGraphicsSceneContextMenuEvent, QGraphicsSceneHoverEvent, and QWheelEvent.
Member Function Documentation
[virtual noexcept] QGraphicsSceneWheelEvent::~QGraphicsSceneWheelEvent()
Destroys the QGraphicsSceneWheelEvent.
Qt::MouseButtons QGraphicsSceneWheelEvent::buttons() const
Returns the mouse buttons that were pressed when the wheel event occurred.
See also 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
Returns whether the delta values delivered with the event are inverted.
This function was introduced in Qt 6.2.
Qt::KeyboardModifiers QGraphicsSceneWheelEvent::modifiers() const
Returns the keyboard modifiers that were active when the wheel event occurred.
See also buttons().
Qt::Orientation QGraphicsSceneWheelEvent::orientation() const
Returns the wheel orientation.
[since 6.2] Qt::ScrollPhase QGraphicsSceneWheelEvent::phase() const
Returns the scrolling phase of this wheel event.
This function was introduced in Qt 6.2.
See also QWheelEvent::phase.
[since 6.2] QPoint QGraphicsSceneWheelEvent::pixelDelta() const
Returns the scrolling distance in pixels on screen. This value is provided on platforms that support high-resolution pixel-based delta values, such as macOS. The value should be used directly to scroll content on screen.
This function was introduced in Qt 6.2.
See also QWheelEvent::pixelDelta.
QPointF QGraphicsSceneWheelEvent::pos() const
Returns the position of the cursor in item coordinates when the wheel event occurred.
See also scenePos() and screenPos().
QPointF QGraphicsSceneWheelEvent::scenePos() const
Returns the position of the cursor in scene coordinates when the wheel event occurred.
See also pos() and screenPos().
QPoint QGraphicsSceneWheelEvent::screenPos() const
Returns the position of the cursor in screen coordinates when the wheel event occurred.