QTouchDeviceclass describes the device from which touch events originate. 更多 …
def
capabilities
()
def
maximumTouchPoints
()
def
name
()
def
setCapabilities
(caps)
def
setMaximumTouchPoints
(max)
def
setName
(name)
def
setType
(devType)
def
type
()
每
QTouchEventcontains aQTouchDevicepointer 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 touch devices via QWindowSystemInterface before generating any touch events. Applications do not need to instantiate this class, they should just access the global instances pointed to bydevice().
QTouchDevice
¶
Creates a new touch device instance. By default the name is empty, the only capability is Position and type is
TouchScreen
.
PySide2.QtGui.QTouchDevice.
DeviceType
¶
This enum represents the type of device that generated a
QTouchEvent
.
|
常量 |
描述 |
|---|---|
|
QTouchDevice.TouchScreen |
In this type of device, the touch surface and display are integrated. This means the surface and display typically have the same size, such that there is a direct relationship between the touch points’ physical positions and the coordinate reported by
|
|
QTouchDevice.TouchPad |
In this type of device, the touch surface is separate from the display. There is not a direct relationship between the physical touch location and the on-screen coordinates. Instead, they are calculated relative to the current mouse position, and the user must use the touch-pad to move this reference point. Unlike touch-screens, Qt allows users to only interact with a single
|
PySide2.QtGui.QTouchDevice.
CapabilityFlag
¶
此枚举用于
capabilities()
to indicate what kind of information the touch device or its driver can provide.
|
常量 |
描述 |
|---|---|
|
QTouchDevice.Position |
Indicates that position information is available, meaning that the pos() family of functions in the touch points return valid points. |
|
QTouchDevice.Area |
Indicates that touch area information is available, meaning that the rect() family of functions in the touch points return valid rectangles. |
|
QTouchDevice.Pressure |
Indicates that pressure information is available, meaning that pressure() returns a valid value. |
|
QTouchDevice.Velocity |
Indicates that velocity information is available, meaning that velocity() returns a valid vector. |
|
QTouchDevice.RawPositions |
Indicates that the list returned by
|
|
QTouchDevice.NormalizedPosition |
Indicates that the normalized position is available, meaning that normalizedPos() returns a valid value. |
|
QTouchDevice.MouseEmulation |
Indicates that the device synthesizes mouse events. This enum value has been introduced in Qt 5.5. |
PySide2.QtGui.QTouchDevice.
capabilities
(
)
¶
Capabilities
Returns the touch device capabilities.
另请参阅
PySide2.QtGui.QTouchDevice.
devices
(
)
¶
Returns a list of all registered devices.
注意
The returned list cannot be used to add new devices. To add a simulated touch screen for an autotest,
createTouchDevice()
can be used. To add real touch screens to QPA plugins, the private
QWindowSystemInterface::registerTouchDevice()
function can be used.
PySide2.QtGui.QTouchDevice.
maximumTouchPoints
(
)
¶
int
Returns the maximum number of simultaneous touch points (fingers) that can be detected.
PySide2.QtGui.QTouchDevice.
name
(
)
¶
unicode
Returns the touch device name.
This string may often be empty. It is however useful for systems that have more than one touch input device because there it can be used to differentiate between the devices (i.e. to tell from which device a
QTouchEvent
originates from).
另请参阅
PySide2.QtGui.QTouchDevice.
setCapabilities
(
caps
)
¶
caps
–
Capabilities
Sets the capabilities
caps
supported by the device and its driver.
另请参阅
PySide2.QtGui.QTouchDevice.
setMaximumTouchPoints
(
max
)
¶
max
–
int
Sets the maximum number of simultaneous touchpoints
max
supported by the device and its driver.
另请参阅
PySide2.QtGui.QTouchDevice.
setName
(
name
)
¶
name – unicode
设置
name
(a unique identifier) for the device. In most systems it is enough to leave this unset and keep the default empty name. This identifier becomes important when having multiple touch devices and a need to differentiate between them.
另请参阅
PySide2.QtGui.QTouchDevice.
setType
(
devType
)
¶
devType
–
DeviceType
Sets the device type
devType
.
另请参阅
PySide2.QtGui.QTouchDevice.
type
(
)
¶
Returns the touch device type.
另请参阅