Struct qt_gui::QTouchDevice
source · #[repr(C)]pub struct QTouchDevice { /* private fields */ }
Expand description
The QTouchDevice class describes the device from which touch events originate.
C++ class: QTouchDevice
.
The QTouchDevice class describes the device from which touch events originate.
Each QTouchEvent contains a QTouchDevice 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 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 by QTouchEvent::device().
Implementations§
source§impl QTouchDevice
impl QTouchDevice
sourcepub unsafe fn capabilities(&self) -> QFlags<CapabilityFlag>
pub unsafe fn capabilities(&self) -> QFlags<CapabilityFlag>
Returns the touch device capabilities.
Calls C++ function: QFlags<QTouchDevice::CapabilityFlag> QTouchDevice::capabilities() const
.
Returns the touch device capabilities.
See also setCapabilities().
sourcepub unsafe fn copy_from(
&self,
other: impl CastInto<Ref<QTouchDevice>>
) -> Ref<QTouchDevice>
pub unsafe fn copy_from( &self, other: impl CastInto<Ref<QTouchDevice>> ) -> Ref<QTouchDevice>
The QTouchDevice class describes the device from which touch events originate.
Calls C++ function: QTouchDevice& QTouchDevice::operator=(const QTouchDevice& other)
.
The QTouchDevice class describes the device from which touch events originate.
Each QTouchEvent contains a QTouchDevice 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 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 by QTouchEvent::device().
sourcepub unsafe fn devices() -> CppBox<QListOfQTouchDevice>
pub unsafe fn devices() -> CppBox<QListOfQTouchDevice>
Returns a list of all registered devices.
Calls C++ function: static QList<const QTouchDevice*> QTouchDevice::devices()
.
Returns a list of all registered devices.
Note: The returned list cannot be used to add new devices. To add a simulated touch screen for an autotest, QTest::createTouchDevice() can be used. To add real touch screens to QPA plugins, the private QWindowSystemInterface::registerTouchDevice()
function can be used.
sourcepub unsafe fn maximum_touch_points(&self) -> c_int
pub unsafe fn maximum_touch_points(&self) -> c_int
Returns the maximum number of simultaneous touch points (fingers) that can be detected.
Calls C++ function: int QTouchDevice::maximumTouchPoints() const
.
Returns the maximum number of simultaneous touch points (fingers) that can be detected.
This function was introduced in Qt 5.2.
See also setMaximumTouchPoints().
sourcepub unsafe fn name(&self) -> CppBox<QString>
pub unsafe fn name(&self) -> CppBox<QString>
Returns the touch device name.
Calls C++ function: QString QTouchDevice::name() const
.
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).
See also setName().
sourcepub unsafe fn new() -> CppBox<QTouchDevice>
pub unsafe fn new() -> CppBox<QTouchDevice>
Creates a new touch device instance. By default the name is empty, the only capability is Position and type is TouchScreen.
Calls C++ function: [constructor] void QTouchDevice::QTouchDevice()
.
Creates a new touch device instance. By default the name is empty, the only capability is Position and type is TouchScreen.
sourcepub unsafe fn new_copy(
other: impl CastInto<Ref<QTouchDevice>>
) -> CppBox<QTouchDevice>
pub unsafe fn new_copy( other: impl CastInto<Ref<QTouchDevice>> ) -> CppBox<QTouchDevice>
The QTouchDevice class describes the device from which touch events originate.
Calls C++ function: [constructor] void QTouchDevice::QTouchDevice(const QTouchDevice& other)
.
The QTouchDevice class describes the device from which touch events originate.
Each QTouchEvent contains a QTouchDevice 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 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 by QTouchEvent::device().
sourcepub unsafe fn set_capabilities(&self, caps: QFlags<CapabilityFlag>)
pub unsafe fn set_capabilities(&self, caps: QFlags<CapabilityFlag>)
Sets the capabilities caps supported by the device and its driver.
Calls C++ function: void QTouchDevice::setCapabilities(QFlags<QTouchDevice::CapabilityFlag> caps)
.
Sets the capabilities caps supported by the device and its driver.
See also capabilities().
sourcepub unsafe fn set_maximum_touch_points(&self, max: c_int)
pub unsafe fn set_maximum_touch_points(&self, max: c_int)
Sets the maximum number of simultaneous touchpoints max supported by the device and its driver.
Calls C++ function: void QTouchDevice::setMaximumTouchPoints(int max)
.
Sets the maximum number of simultaneous touchpoints max supported by the device and its driver.
See also maximumTouchPoints().
sourcepub unsafe fn set_name(&self, name: impl CastInto<Ref<QString>>)
pub unsafe fn set_name(&self, name: impl CastInto<Ref<QString>>)
Sets the 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.
Calls C++ function: void QTouchDevice::setName(const QString& name)
.
Sets the 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.
See also name().
sourcepub unsafe fn set_type(&self, dev_type: DeviceType)
pub unsafe fn set_type(&self, dev_type: DeviceType)
Sets the device type devType.
Calls C++ function: void QTouchDevice::setType(QTouchDevice::DeviceType devType)
.
Sets the device type devType.
See also type().
sourcepub unsafe fn static_meta_object() -> Ref<QMetaObject>
pub unsafe fn static_meta_object() -> Ref<QMetaObject>
Returns a reference to the staticMetaObject
field.
sourcepub unsafe fn type_(&self) -> DeviceType
pub unsafe fn type_(&self) -> DeviceType
Returns the touch device type.
Calls C++ function: QTouchDevice::DeviceType QTouchDevice::type() const
.
Returns the touch device type.
See also setType().