Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QPointingDeviceUniqueId Class Reference

QPointingDeviceUniqueId identifies a unique object, such as a tagged token or stylus, which is used with a pointing device. More...

#include <qpointingdevice.h>

+ Collaboration diagram for QPointingDeviceUniqueId:

Public Member Functions

Q_ALWAYS_INLINE constexpr QPointingDeviceUniqueId () noexcept
 Constructs an invalid unique pointer ID.
 
Q_ALWAYS_INLINE constexpr bool isValid () const noexcept
 Returns whether this unique pointer ID is valid, that is, it represents an actual pointer.
 
qint64 numericId () const noexcept
 

Static Public Member Functions

static QPointingDeviceUniqueId fromNumericId (qint64 id)
 Constructs a unique pointer ID from numeric ID id.
 

Properties

qint64 numericId
 the numeric unique ID of the token represented by a touchpoint
 

Friends

bool operator== (QPointingDeviceUniqueId lhs, QPointingDeviceUniqueId rhs) noexcept
 
bool operator!= (QPointingDeviceUniqueId lhs, QPointingDeviceUniqueId rhs) noexcept
 

Related Symbols

(Note that these are not member symbols.)

size_t qHash (QPointingDeviceUniqueId key, size_t seed) noexcept
 

Detailed Description

QPointingDeviceUniqueId identifies a unique object, such as a tagged token or stylus, which is used with a pointing device.

Since
5.8

\inmodule QtGui

QPointingDeviceUniqueIds can be compared for equality, and can be used as keys in a QHash. You get access to the numerical ID via numericId(), if the device supports such IDs. For future extensions, though, you should not use that function, but compare objects of this type using the equality operator.

This class is a thin wrapper around an integer ID. You pass it into and out of functions by value.

See also
QEventPoint

Definition at line 20 of file qpointingdevice.h.

Constructor & Destructor Documentation

◆ QPointingDeviceUniqueId()

QPointingDeviceUniqueId::QPointingDeviceUniqueId ( )
inlineconstexprnoexcept

Constructs an invalid unique pointer ID.

Definition at line 26 of file qpointingdevice.h.

Member Function Documentation

◆ fromNumericId()

QPointingDeviceUniqueId QPointingDeviceUniqueId::fromNumericId ( qint64 id)
static

Constructs a unique pointer ID from numeric ID id.

Definition at line 762 of file qpointingdevice.cpp.

Referenced by createInputDevice(), QWindowsPointerHandler::createTouchDevice(), QWindowSystemInterfacePrivate::fromNativeTouchPoints(), QWindowSystemInterface::handleTabletEnterProximityEvent(), QWindowSystemInterface::handleTabletEvent(), and QWindowSystemInterface::handleTabletLeaveProximityEvent().

+ Here is the caller graph for this function:

◆ isValid()

bool QPointingDeviceUniqueId::isValid ( ) const
inlineconstexprnoexcept

Returns whether this unique pointer ID is valid, that is, it represents an actual pointer.

Definition at line 32 of file qpointingdevice.h.

◆ numericId()

qint64 QPointingDeviceUniqueId::numericId ( ) const
noexcept

Definition at line 789 of file qpointingdevice.cpp.

Friends And Related Symbol Documentation

◆ operator!=

bool QPointingDeviceUniqueId::operator!= ( QPointingDeviceUniqueId lhs,
QPointingDeviceUniqueId rhs )
friend
Since
5.8

Returns whether the two unique pointer IDs lhs and rhs identify different pointers (true) or not (false).

Definition at line 38 of file qpointingdevice.h.

◆ operator==

bool QPointingDeviceUniqueId::operator== ( QPointingDeviceUniqueId lhs,
QPointingDeviceUniqueId rhs )
friend
Since
5.8

Returns whether the two unique pointer IDs lhs and rhs identify the same pointer (true) or not (false).

Definition at line 36 of file qpointingdevice.h.

◆ qHash()

size_t qHash ( QPointingDeviceUniqueId key,
size_t seed )
related
Since
5.8

Returns the hash value for key, using seed to seed the calculation.

Definition at line 816 of file qpointingdevice.cpp.

References qHash(), and seed.

+ Here is the call graph for this function:

Property Documentation

◆ numericId

QPointingDeviceUniqueId::numericId
read

the numeric unique ID of the token represented by a touchpoint

If the device provides a numeric ID, isValid() returns true, and this property provides the numeric ID; otherwise it is -1.

You should not use the value of this property in portable code, but instead rely on equality to identify pointers.

See also
isValid()

Definition at line 23 of file qpointingdevice.h.

Referenced by QGuiApplicationPrivate::processTabletEnterProximityEvent(), QGuiApplicationPrivate::processTabletLeaveProximityEvent(), QPointingDevicePrivate::queryTabletDevice(), QPointingDevicePrivate::tabletDevice(), and QWindowsTabletSupport::translateTabletPacketEvent().


The documentation for this class was generated from the following files: