WheelEvent QML Type

Provides information about a mouse wheel event More...

Import Statement: import QtQuick 2.7

Properties

Detailed Description

The position of the mouse can be found via the x and y properties.

See also MouseArea.

Property Documentation

accepted : bool

Setting accepted to true prevents the wheel event from being propagated to items below this item.

Generally, if the item acts on the wheel event then it should be accepted so that items lower in the stacking order do not also respond to the same event.


angleDelta : point

This property holds the distance that the wheel is rotated in wheel degrees. The x and y cordinate of this property holds the delta in horizontal and vertical orientation.

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.


buttons : int

This property holds the mouse buttons pressed when the wheel event was generated.

It contains a bitwise combination of:

  • Qt.LeftButton
  • Qt.RightButton
  • Qt.MiddleButton

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:

MouseArea {
    onWheel: {
        if (wheel.modifiers & Qt.ControlModifier) {
            adjustZoom(wheel.angleDelta.y / 120);
        }
    }
}

pixelDelta : point

This property holds the delta in screen pixels and is available in platforms that have high-resolution trackpads, such as OS X. The x and y cordinate of this property holds the delta in horizontal and vertical orientation. The value should 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.


x : int

These properties hold the coordinates of the position supplied by the wheel event.


y : int

These properties hold the coordinates of the position supplied by the wheel event.


© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.