WheelEvent QML Type▲
-
Import Statement: import QtQuick
-
Group: WheelEvent is part of qtquick-input-events
Detailed Description▲
The position of the mouse can be found via the x and y properties.
See Also▲
See also WheelHandler, MouseArea
Property Documentation▲
[read-only] x : real▲
[read-only] y : real
These properties hold the coordinates of the position supplied by the wheel event.
See Also▲
See also QWheelEvent::position()
accepted : bool▲
Setting accepted to true prevents the wheel event from being propagated to items below the receiving item or handler.
Generally, if the item acts on the wheel event, it should be accepted so that items lower in the stacking order do not also respond to the same event.
See Also▲
See also QWheelEvent::accepted
[read-only] angleDelta : point▲
This property holds the relative amount that the wheel was rotated, in eighths of a degree. The x and y coordinates of this property hold the delta in horizontal and vertical orientations, respectively.
A positive value indicates that the wheel was rotated up/right; a negative value indicates that the wheel was rotated down/left.
Most mouse types work in steps of 15 degrees, in which case the delta value is a multiple of 120; i.e., 120 units * 1/8 = 15 degrees.
See Also▲
See also QWheelEvent::angleDelta()
[read-only] buttons : int▲
[read-only] inverted : bool▲
Returns whether the delta values delivered with the event are inverted.
Normally, a vertical wheel will produce a WheelEvent with positive delta values if the top of the wheel is rotating away from the hand operating it. Similarly, a horizontal wheel movement will produce a QWheelEvent with positive delta values if the top of the wheel is moved to the left.
However, on some platforms this is configurable, so that the same operations described above will produce negative delta values (but with the same magnitude). For instance, in a QML component (such as a tumbler or a slider) where it is appropriate to synchronize the movement or rotation of an item with the direction of the wheel, regardless of the system settings, the wheel event handler can use the inverted property to decide whether to negate the angleDelta or pixelDelta values.
Many platforms provide no such information. On such platforms inverted always returns false.
See Also▲
See also QWheelEvent::inverted()
[read-only] modifiers : int▲
This property holds the keyboard modifier flags that existed immediately before the event occurred.
It contains a bitwise combination of:
-
Qt.NoModifier - No modifier key is pressed.
-
Qt.ShiftModifier - A Shift key on the keyboard is pressed.
-
Qt.ControlModifier - A Ctrl key on the keyboard is pressed.
-
Qt.AltModifier - An Alt key on the keyboard is pressed.
-
Qt.MetaModifier - A Meta key on the keyboard is pressed.
-
Qt.KeypadModifier - A keypad button is pressed.
For example, to react to a Control key pressed during the wheel event:
WheelHandler {
onWheel
:
(wheel)=&
gt; {
if
(wheel.modifiers &
amp; Qt.ControlModifier) {
adjustZoom
(
wheel.
angleDelta.
y /
120
);
}
}
}
See Also▲
See also QWheelEvent::modifiers()
[read-only] pixelDelta : point▲
This property holds the delta in screen pixels and is available in platforms that have high-resolution trackpads, such as macOS. The x and y coordinates of this property hold the delta in horizontal and vertical orientations, respectively. The values can be used directly to scroll content on screen.
For platforms without high-resolution trackpad support, pixelDelta will always be (0,0), and angleDelta should be used instead.
See Also▲
See also QWheelEvent::pixelDelta()