QWheelEvent
Hierarchy
↳ QWheelEvent
Index
Constructors
Properties
Methods
- accept
- angleDelta
- button
- buttons
- globalPosition
- ignore
- inverted
- isAccepted
- modifiers
- phase
- pixelDelta
- position
- scenePosition
- setAccepted
- spontaneous
- timestamp
- type
Constructors
constructor
+ new QWheelEvent(event
: NativeRawPointer‹"QEvent"›): QWheelEvent
Overrides QEvent.constructor
Parameters:
Name | Type |
---|---|
event | NativeRawPointer‹"QEvent"› |
Returns: QWheelEvent
Properties
native
• native: NativeElement
Methods
accept
▸ accept(): void
Sets the accept flag of the event object, the equivalent of calling setAccepted(true). Setting the accept parameter indicates that the event receiver wants the event. Unwanted events might be propagated to the parent widget
Returns: void
angleDelta
▸ angleDelta(): object
Returns the relative amount that the wheel was rotated, in eighths 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.
angleDelta().y() provides the angle through which the common vertical mouse wheel was rotated since the previous event. angleDelta().x() provides the angle through which the horizontal mouse wheel was rotated, if the mouse has a horizontal wheel; otherwise it stays at zero.
Some mice allow the user to tilt the wheel to perform horizontal scrolling, and some touchpads support a horizontal scrolling gesture; that will also appear in angleDelta().x().
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.
However, some mice have finer-resolution wheels and send delta values that are less than 120 units (less than 15 degrees). To support this possibility, you can either cumulatively add the delta values from events until the value of 120 is reached, then scroll the widget, or you can partially scroll the widget in response to each wheel event.
But to provide a more native feel, you should prefer pixelDelta() on platforms where it's available.
Returns: object
-
x: number
-
y: number
button
▸ button(): number
Inherited from QSinglePointEvent.button
Returns: number
buttons
▸ buttons(): number
Inherited from QSinglePointEvent.buttons
Returns: number
globalPosition
▸ globalPosition(): object
Overrides QSinglePointEvent.globalPosition
Returns the global position of the mouse pointer at the time of the event. This is important on asynchronous window systems such as X11; whenever you move your widgets around in response to mouse events, globalPosition() can differ a lot from the current cursor position returned by QCursor::pos().
Returns: object
-
x: number
-
y: number
ignore
▸ ignore(): void
Clears the accept flag parameter of the event object, the equivalent of calling setAccepted(false). Clearing the accept parameter indicates that the event receiver does not want the event. Unwanted events might be propagated to the parent widget.
Returns: void
inverted
▸ inverted(): boolean
Returns whether the delta values delivered with the event are inverted
Returns: boolean
isAccepted
▸ isAccepted(): boolean
Inherited from QEvent.isAccepted
Returns: boolean
modifiers
▸ modifiers(): KeyboardModifier
Inherited from QInputEvent.modifiers
Returns: KeyboardModifier