QPointingDevice¶
The QPointingDevice
class describes a device from which mouse, touch or tablet events originate. More…
New in version 6.0.
Synopsis¶
Functions¶
def
__eq__
(other)def
buttonCount
()def
maximumPoints
()def
pointerType
()def
setCapabilities
(caps)def
setMaximumTouchPoints
(c)def
setType
(devType)def
uniqueId
()
Signals¶
def
grabChanged
(grabber, transition, event, point)
Static functions¶
def
primaryPointingDevice
([seatName=””])
Detailed Description¶
Each QPointerEvent
contains a QPointingDevice
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 by device()
.
- class PySide6.QtGui.QPointingDevice([parent=None])¶
PySide6.QtGui.QPointingDevice(name, systemId, devType, pType, caps, maxPoints, buttonCount[, seatName=””[, uniqueId=QPointingDeviceUniqueId()[, parent=None]]])
- Parameters
devType –
DeviceType
buttonCount – int
maxPoints – int
caps –
Capabilities
uniqueId –
PySide6.QtGui.QPointingDeviceUniqueId
name – str
seatName – str
systemId – int
pType –
PointerType
parent –
PySide6.QtCore.QObject
Creates a new invalid pointing device instance as a child of parent
.
Creates a new pointing device instance with the given name
, deviceType
, pointerType
, capabilities
, maxPoints
, buttonCount
, seatName
, uniqueId
and parent
.
- PySide6.QtGui.QPointingDevice.PointerType¶
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 the DeviceType
is TouchScreen
and PointerType
is Finger
(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 every QPointerEvent
has a , and it can simplify some event handling code to ignore the DeviceType and react differently depending on the 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).
- PySide6.QtGui.QPointingDevice.GrabTransition¶
- PySide6.QtGui.QPointingDevice.buttonCount()¶
- Return type
int
- PySide6.QtGui.QPointingDevice.grabChanged(grabber, transition, event, point)¶
- Parameters
grabber –
PySide6.QtCore.QObject
transition –
GrabTransition
event –
PySide6.QtGui.QPointerEvent
point –
PySide6.QtGui.QEventPoint
- PySide6.QtGui.QPointingDevice.maximumPoints()¶
- Return type
int
- PySide6.QtGui.QPointingDevice.__eq__(other)¶
- Parameters
other –
PySide6.QtGui.QPointingDevice
- Return type
bool
- PySide6.QtGui.QPointingDevice.pointerType()¶
- Return type
- static PySide6.QtGui.QPointingDevice.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.
- PySide6.QtGui.QPointingDevice.setCapabilities(caps)¶
- Parameters
caps –
Capabilities
Note
This function is deprecated.
Please use the constructor rather than setters.
- PySide6.QtGui.QPointingDevice.setMaximumTouchPoints(c)¶
- Parameters
c – int
Note
This function is deprecated.
Please use the constructor rather than setters.
- PySide6.QtGui.QPointingDevice.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.
- PySide6.QtGui.QPointingDevice.uniqueId()¶
- Return type
© 2022 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.