QGraphicsSceneWheelEvent Class
The QGraphicsSceneWheelEvent class provides wheel events in the graphics view framework. More...
Header: | #include <QGraphicsSceneWheelEvent> |
Inherits: | QGraphicsSceneEvent |
Public Functions
QGraphicsSceneWheelEvent(Type type = None) | |
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 |
void | setButtons(Qt::MouseButtons buttons) |
void | setDelta(int delta) |
void | setInverted(bool inverted) |
void | setModifiers(Qt::KeyboardModifiers modifiers) |
void | setOrientation(Qt::Orientation orientation) |
void | setPhase(Qt::ScrollPhase scrollPhase) |
void | setPixelDelta(QPoint pixelDelta) |
void | setPos(const QPointF &pos) |
void | setScenePos(const QPointF &pos) |
void | setScreenPos(const QPoint &pos) |
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
[explicit]
QGraphicsSceneWheelEvent::QGraphicsSceneWheelEvent(Type type = None)
\internal
Constructs a QGraphicsSceneWheelEvent of type type, which is always QEvent::GraphicsSceneWheel.
[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 setButtons() and 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).
See also setDelta().
bool QGraphicsSceneWheelEvent::isInverted() const
Returns whether the delta values delivered with the event are inverted.
\since
6.2
Qt::KeyboardModifiers QGraphicsSceneWheelEvent::modifiers() const
Returns the keyboard modifiers that were active when the wheel event occurred.
See also setModifiers() and buttons().
Qt::Orientation QGraphicsSceneWheelEvent::orientation() const
Returns the wheel orientation.
See also setOrientation().
Qt::ScrollPhase QGraphicsSceneWheelEvent::phase() const
\since
6.2
Returns the scrolling phase of this wheel event.
See also setPhase() and QWheelEvent::phase.
QPoint QGraphicsSceneWheelEvent::pixelDelta() const
\since
6.2
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.
See also setPixelDelta() and QWheelEvent::pixelDelta.
QPointF QGraphicsSceneWheelEvent::pos() const
Returns the position of the cursor in item coordinates when the wheel event occurred.
See also setPos(), scenePos(), and screenPos().
QPointF QGraphicsSceneWheelEvent::scenePos() const
Returns the position of the cursor in scene coordinates when the wheel event occurred.
See also setScenePos(), pos(), and screenPos().
QPoint QGraphicsSceneWheelEvent::screenPos() const
Returns the position of the cursor in screen coordinates when the wheel event occurred.
See also setScreenPos(), pos(), and scenePos().
void QGraphicsSceneWheelEvent::setButtons(Qt::MouseButtons buttons)
\internal
See also buttons().
void QGraphicsSceneWheelEvent::setDelta(int delta)
\internal
See also delta().
void QGraphicsSceneWheelEvent::setInverted(bool inverted)
\internal
See also isInverted().
void QGraphicsSceneWheelEvent::setModifiers(Qt::KeyboardModifiers modifiers)
\internal
See also modifiers().
void QGraphicsSceneWheelEvent::setOrientation(Qt::Orientation orientation)
\internal
See also orientation().
void QGraphicsSceneWheelEvent::setPhase(Qt::ScrollPhase scrollPhase)
\internal
See also phase().
void QGraphicsSceneWheelEvent::setPixelDelta(QPoint pixelDelta)
\internal
See also pixelDelta().
void QGraphicsSceneWheelEvent::setPos(const QPointF &pos)
\internal
See also pos().
void QGraphicsSceneWheelEvent::setScenePos(const QPointF &pos)
\internal
See also scenePos().
void QGraphicsSceneWheelEvent::setScreenPos(const QPoint &pos)
\internal
See also screenPos().