PointerDevice QML Type

QML equivalent for QPointingDevice. More...

Import Statement: import QtQuick
In C++: QPointingDevice

Properties

Signals

  • grabChanged(QtObject grabber, enumeration transition, PointerEvent event, eventPoint point)

Detailed Description

PointerDevice is the QML name of the QPointingDevice class. It has the same properties and enums as QPointingDevice.

Property Documentation

buttonCount : int

This property tells the maximum number of on-device buttons that can be detected.


deviceType : enumeration

This property tells the type of device that generated a PointerEvent.

Valid values are:

ConstantDescription
PointerDevice.UnknownThe device cannot be identified.
PointerDevice.MouseA mouse.
PointerDevice.TouchScreenA touchscreen.
PointerDevice.TouchPadA touchpad or trackpad.
PointerDevice.StylusA stylus on a graphics tablet.
PointerDevice.AirbrushAn airbrush on a graphics tablet.
PointerDevice.PuckA digitizer with crosshairs, on a graphics tablet.

See also QInputDevice::DeviceType and PointerDeviceHandler::acceptedDevices.


maximumPoints : int

This property tells the maximum number of simultaneous touch points (fingers) that can be detected.


pointerType : enumeration

This property tells what is interacting with the PointerDevice.

There is some redundancy between this property and deviceType. For example, if a touchscreen is used, then deviceType is TouchScreen and pointerType is Finger. But on a graphics tablet, it's often possible for both ends of the stylus to be used, and programs need to distinguish them. PointerDeviceHandler::acceptedDevices and PointerDeviceHandler::acceptedPointerTypes can be used in combination to filter the subset of events that a particular handler should react to.

Valid values are:

ConstantDescription
PointerDevice.UnknownThe device cannot be identified.
PointerDevice.GenericA mouse or a device that emulates a mouse.
PointerDevice.FingerA finger on a touchscreen.
PointerDevice.PenA stylus on a graphics tablet.
PointerDevice.EraserAn eraser on a graphics tablet.
PointerDevice.CursorA digitizer with crosshairs, on a graphics tablet.

See also QPointingDevice::PointerType and PointerDeviceHandler::acceptedPointerTypes.


This property may provide a unique ID for the device, if available. For example, a graphics tablet stylus device may have a unique serial number.

See also eventPoint and QEventPoint::uniqueId().


Signal Documentation

grabChanged(QtObject grabber, enumeration transition, PointerEvent event, eventPoint point)

This signal is emitted when the grabber object gains or loses an exclusive or passive grab of point during delivery of event. The transition tells what happened, from the perspective of the grabber object, which may be either an Item or an Input Handler.

Valid values for transition are:

ConstantDescription
PointerDevice.GrabExclusiveThe grabber has taken primary responsibility for handling the point.
PointerDevice.UngrabExclusiveThe grabber has given up its previous exclusive grab.
PointerDevice.CancelGrabExclusiveThe exclusive grab of grabber has been taken over or cancelled.
PointerDevice.GrabPassiveThe grabber has acquired a passive grab, to monitor the point.
PointerDevice.UngrabPassiveThe grabber has given up its previous passive grab.
PointerDevice.CancelGrabPassiveThe previous passive grab has terminated abnormally.

Note: A grab transition from one object to another results in two signals, to notify that one object has lost its grab, and to notify that there is another grabber. In other cases, when transitioning to or from a non-grabbing state, only one signal is emitted.

Note: The corresponding handler is onGrabChanged.

See also QPointerEvent::setExclusiveGrabber(), QPointerEvent::addPassiveGrabber(), QPointerEvent::removePassiveGrabber(), and PointerHandler::grabChanged().