Struct qt_gui::touch_device::TouchDevice
source · #[repr(C)]pub struct TouchDevice(_);
Expand description
C++ type: 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 TouchDevice
impl TouchDevice
sourcepub fn capabilities(&self) -> Flags<CapabilityFlag>
pub fn capabilities(&self) -> Flags<CapabilityFlag>
C++ method: QFlags<QTouchDevice::CapabilityFlag> QTouchDevice::capabilities() const
Returns the touch device capabilities.
See also setCapabilities().
sourcepub fn devices() -> ListTouchDevicePtr
pub fn devices() -> ListTouchDevicePtr
C++ method: static QList<const QTouchDevice*> QTouchDevice::devices()
Returns a list of all registered devices.
Note: The returned list cannot be used to add new devices. Use QWindowSystemInterface::registerTouchDevice() instead.
sourcepub fn maximum_touch_points(&self) -> c_int
pub fn maximum_touch_points(&self) -> c_int
C++ method: 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 fn name(&self) -> String
pub fn name(&self) -> String
C++ method: 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 fn new() -> CppBox<TouchDevice>
pub fn new() -> CppBox<TouchDevice>
C++ method: [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 fn set_capabilities(&mut self, caps: Flags<CapabilityFlag>)
pub fn set_capabilities(&mut self, caps: Flags<CapabilityFlag>)
C++ method: void QTouchDevice::setCapabilities(QFlags<QTouchDevice::CapabilityFlag> caps)
Sets the capabilities caps supported by the device and its driver.
See also capabilities().
sourcepub fn set_maximum_touch_points(&mut self, max: c_int)
pub fn set_maximum_touch_points(&mut self, max: c_int)
C++ method: void QTouchDevice::setMaximumTouchPoints(int max)
Sets the maximum number of simultaneous touchpoints max supported by the device and its driver.
See also maximumTouchPoints().
sourcepub fn set_name(&mut self, name: &String)
pub fn set_name(&mut self, name: &String)
C++ method: 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 fn set_type(&mut self, dev_type: DeviceType)
pub fn set_type(&mut self, dev_type: DeviceType)
C++ method: void QTouchDevice::setType(QTouchDevice::DeviceType devType)
Sets the device type devType.
See also type().
sourcepub fn type_(&self) -> DeviceType
pub fn type_(&self) -> DeviceType
C++ method: QTouchDevice::DeviceType QTouchDevice::type() const
Returns the touch device type.
See also setType().