- class QPointingDevice#
The
QPointingDevice
class describes a device from which mouse, touch or tablet events originate. More…Synopsis#
Properties#
Methods#
def
__init__()
def
buttonCount()
def
maximumPoints()
def
__eq__()
def
pointerType()
def
setType()
def
uniqueId()
Signals#
def
grabChanged()
Static functions#
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description#
Each
QPointerEvent
contains aQPointingDevice
pointer to allow accessing device-specific properties like type and capabilities. It is the responsibility of the platform or generic plug-ins to register the available pointing devices via QWindowSystemInterface before generating any pointer events. Applications do not need to instantiate this class, they should just access the global instances pointed to bydevice()
.- class PointerType#
(inherits
enum.Flag
) This enum represents what is interacting with the pointing device.There is some redundancy between this property and
DeviceType
. For example, if a touchscreen is used, then theDeviceType
isTouchScreen
andPointerType
isFinger
(always). But on a graphics tablet, it’s often possible for both ends of the stylus to be used, and programs need to distinguish them. Therefore the concept is extended so that everyQPointerEvent
has a PointerType, and it can simplify some event handling code to ignore the DeviceType and react differently depending on the PointerType alone.Valid values are:
Constant
Description
QPointingDevice.PointerType.Unknown
The pointer type is unknown.
QPointingDevice.PointerType.Generic
A mouse or something acting like a mouse (the core pointer on X11).
QPointingDevice.PointerType.Finger
The user’s finger.
QPointingDevice.PointerType.Pen
The drawing end of a stylus.
QPointingDevice.PointerType.Eraser
The other end of the stylus (if it has a virtual eraser on the other end).
QPointingDevice.PointerType.Cursor
A transparent circle with cross-hairs as found on a
Puck
device.QPointingDevice.PointerType.AllPointerTypes
Any of the above (used as a default filter value).
- class GrabTransition#
This enum represents a transition of exclusive or passive grab from one object (possibly
nullptr
) to another (possiblynullptr
). It is emitted as an argument of thegrabChanged()
signal.Valid values are:
Constant
Description
QPointingDevice.GrabExclusive
Emitted after
setExclusiveGrabber()
.QPointingDevice.UngrabExclusive
Emitted after
setExclusiveGrabber()
when the grabber is set tonullptr
, to notify that the grab has terminated normally.QPointingDevice.CancelGrabExclusive
Emitted after
setExclusiveGrabber()
when the grabber is set to a different object, to notify that the old grabber’s grab is “stolen”.QPointingDevice.GrabPassive
Emitted after
addPassiveGrabber()
.QPointingDevice.UngrabPassive
Emitted when a passive grab is terminated normally, for example after
removePassiveGrabber()
.QPointingDevice.CancelGrabPassive
Emitted when a passive grab is terminated abnormally (a gesture is canceled).
QPointingDevice.OverrideGrabPassive
This value is not currently used.
Note
Properties can be used directly when
from __feature__ import true_property
is used or via accessor functions otherwise.- property buttonCountᅟ: int#
- Access functions:
- property maximumPointsᅟ: int#
- Access functions:
- property pointerTypeᅟ: QPointingDevice.PointerType#
- Access functions:
- property uniqueIdᅟ: QPointingDeviceUniqueId#
- Access functions:
Creates a new invalid pointing device instance as a child of
parent
.- __init__(name, systemId, devType, pType, caps, maxPoints, buttonCount[, seatName=""[, uniqueId=QPointingDeviceUniqueId()[, parent=None]]])
- Parameters:
name – str
systemId – int
devType –
DeviceType
pType –
PointerType
caps – Combination of
Capability
maxPoints – int
buttonCount – int
seatName – str
uniqueId –
QPointingDeviceUniqueId
parent –
QObject
Creates a new pointing device instance with the given
name
,deviceType
,pointerType
,capabilities
,maxPoints
,buttonCount
,seatName
,uniqueId
andparent
.- buttonCount()#
- Return type:
int
Returns the maximum number of on-device buttons that can be detected.
Getter of property
buttonCountᅟ
.- grabChanged(grabber, transition, event, point)#
- Parameters:
grabber –
QObject
transition –
GrabTransition
event –
QPointerEvent
point –
QEventPoint
This signal is emitted when the
grabber
object gains or loses an exclusive or passive grab ofpoint
during delivery ofevent
. Thetransition
tells what happened, from the perspective of thegrabber
object.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: the
grabber
argument is nevernullptr
.- maximumPoints()#
- Return type:
int
Returns the maximum number of simultaneous touch points (fingers) that can be detected.
Getter of property
maximumPointsᅟ
.- __eq__(other)#
- Parameters:
other –
QPointingDevice
- Return type:
bool
- pointerType()#
- Return type:
Returns the pointer type.
Getter of property
pointerTypeᅟ
.- static primaryPointingDevice([seatName=""])#
- Parameters:
seatName – str
- Return type:
Returns the primary pointing device (the core pointer, traditionally assumed to be a mouse) on the given seat
seatName
.If multiple pointing devices are registered, this function prefers a mouse or touchpad that matches the given
seatName
and that does not have another device as its parent. Usually only one master or core device does not have a parent device. But if such a device is not found, this function creates a new virtual “core pointer” mouse. Thus Qt continues to work on platforms that are not yet doing input device discovery and registration.- setCapabilities(caps)#
- Parameters:
caps – Combination of
Capability
Note
This function is deprecated.
Please use the constructor rather than setters.
- setMaximumTouchPoints(c)#
- Parameters:
c – int
Note
This function is deprecated.
Please use the constructor rather than setters.
- setType(devType)#
- Parameters:
devType –
DeviceType
Note
This function is deprecated.
Please use the constructor rather than setters.
Sets the device type
devType
and infers the pointer type.- uniqueId()#
- Return type:
Returns a unique ID (of dubious utility) for the device.
You probably should rather be concerned with QPointerEventPoint::uniqueId().
Getter of property
uniqueIdᅟ
.