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.

C++ documentation:

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

source

pub unsafe fn capabilities(&self) -> QFlags<CapabilityFlag>

Returns the touch device capabilities.

Calls C++ function: QFlags<QTouchDevice::CapabilityFlag> QTouchDevice::capabilities() const.

C++ documentation:

Returns the touch device capabilities.

See also setCapabilities().

source

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).

C++ documentation:

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().

source

pub unsafe fn devices() -> CppBox<QListOfQTouchDevice>

Returns a list of all registered devices.

Calls C++ function: static QList<const QTouchDevice*> QTouchDevice::devices().

C++ documentation:

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.

source

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.

C++ documentation:

Returns the maximum number of simultaneous touch points (fingers) that can be detected.

This function was introduced in Qt 5.2.

See also setMaximumTouchPoints().

source

pub unsafe fn name(&self) -> CppBox<QString>

Returns the touch device name.

Calls C++ function: QString QTouchDevice::name() const.

C++ documentation:

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().

source

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().

C++ documentation:

Creates a new touch device instance. By default the name is empty, the only capability is Position and type is TouchScreen.

source

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).

C++ documentation:

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().

source

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).

C++ documentation:

Sets the capabilities caps supported by the device and its driver.

See also capabilities().

source

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).

C++ documentation:

Sets the maximum number of simultaneous touchpoints max supported by the device and its driver.

See also maximumTouchPoints().

source

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).

C++ documentation:

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().

source

pub unsafe fn set_type(&self, dev_type: DeviceType)

Sets the device type devType.

Calls C++ function: void QTouchDevice::setType(QTouchDevice::DeviceType devType).

C++ documentation:

Sets the device type devType.

See also type().

source

pub unsafe fn static_meta_object() -> Ref<QMetaObject>

Returns a reference to the staticMetaObject field.

source

pub unsafe fn type_(&self) -> DeviceType

Returns the touch device type.

Calls C++ function: QTouchDevice::DeviceType QTouchDevice::type() const.

C++ documentation:

Returns the touch device type.

See also setType().

Trait Implementations§

source§

impl CppDeletable for QTouchDevice

source§

unsafe fn delete(&self)

Destroys a touch device instance.

Calls C++ function: [destructor] void QTouchDevice::~QTouchDevice().

C++ documentation:

Destroys a touch device instance.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T, U> CastInto<U> for T
where U: CastFrom<T>,

source§

unsafe fn cast_into(self) -> U

Performs the conversion. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> StaticUpcast<T> for T

source§

unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>

Convert type of a const pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.