Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QPointingDevicePrivate Class Reference

#include <qpointingdevice_p.h>

Inheritance diagram for QPointingDevicePrivate:
Collaboration diagram for QPointingDevicePrivate:

Classes

struct  EventPointData

Public Types

using EventPointMap = QVarLengthFlatMap<int, EventPointData, 20>
Public Types inherited from QObjectPrivate
typedef void(* StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **)
using ConnectionDataPointer = QExplicitlySharedDataPointer<ConnectionData>

Public Member Functions

 QPointingDevicePrivate (const QString &name, qint64 id, QInputDevice::DeviceType type, QPointingDevice::PointerType pType, QPointingDevice::Capabilities caps, int maxPoints, int buttonCount, const QString &seatName=QString(), QPointingDeviceUniqueId uniqueId=QPointingDeviceUniqueId())
 ~QPointingDevicePrivate () override
void sendTouchCancelEvent (QTouchEvent *cancelEvent)
EventPointDataqueryPointById (int id) const
EventPointDatapointById (int id) const
void removePointById (int id)
QObjectfirstActiveTarget () const
QWindowfirstActiveWindow () const
QObjectfirstPointExclusiveGrabber () const
void setExclusiveGrabber (const QPointerEvent *event, const QEventPoint &point, QObject *exclusiveGrabber)
bool removeExclusiveGrabber (const QPointerEvent *event, const QObject *grabber)
bool addPassiveGrabber (const QPointerEvent *event, const QEventPoint &point, QObject *grabber)
bool removePassiveGrabber (const QPointerEvent *event, const QEventPoint &point, QObject *grabber)
void clearPassiveGrabbers (const QPointerEvent *event, const QEventPoint &point)
void removeGrabber (QObject *grabber, bool cancel=false)
Public Member Functions inherited from QInputDevicePrivate
 QInputDevicePrivate (const QString &name, qint64 winSysId, QInputDevice::DeviceType type, QInputDevice::Capabilities caps=QInputDevice::Capability::None, const QString &seatName=QString())
 ~QInputDevicePrivate () override
void setAvailableVirtualGeometry (QRect a)
void setCapabilities (QInputDevice::Capabilities c)
Public Member Functions inherited from QObjectPrivate
void ensureExtraData ()
void setObjectNameWithoutBindings (const QString &name)
 QObjectPrivate (decltype(QObjectPrivateVersion) version=QObjectPrivateVersion)
virtual ~QObjectPrivate ()
void deleteChildren ()
void clearBindingStorage ()
void setParent_helper (QObject *)
void moveToThread_helper ()
void setThreadData_helper (QThreadData *currentData, QThreadData *targetData, QBindingStatus *status)
QObjectList receiverList (const char *signal) const
void ensureConnectionData ()
void addConnection (int signal, Connection *c)
int signalIndex (const char *signalName, const QMetaObject **meta=nullptr) const
bool isSignalConnected (uint signalIdx, bool checkDeclarative=true) const
bool maybeSignalConnected (uint signalIndex) const
bool isDeclarativeSignalConnected (uint signalIdx) const
void connectNotify (const QMetaMethod &signal)
void disconnectNotify (const QMetaMethod &signal)
void reinitBindingStorageAfterThreadMove ()
virtual std::string flagsForDumping () const
virtual void writeToDebugStream (QDebug &) const
QtPrivate::QPropertyAdaptorSlotObjectgetPropertyAdaptorSlotObject (const QMetaProperty &property)
Public Member Functions inherited from QObjectData
 QObjectData ()=default
virtual ~QObjectData ()=0
const QMetaObjectdynamicMetaObject () const

Static Public Member Functions

static bool setPassiveGrabberContext (EventPointData *epd, QObject *grabber, QObject *context)
static QPointingDevicePrivateget (QPointingDevice *q)
static const QPointingDevicePrivateget (const QPointingDevice *q)
static const QPointingDevicetabletDevice (QInputDevice::DeviceType deviceType, QPointingDevice::PointerType pointerType, QPointingDeviceUniqueId uniqueId)
static const QPointingDevicequeryTabletDevice (QInputDevice::DeviceType deviceType, QPointingDevice::PointerType pointerType, QPointingDeviceUniqueId uniqueId, QInputDevice::Capabilities capabilities=QInputDevice::Capability::None, qint64 systemId=0)
static const QPointingDevicepointingDeviceById (qint64 systemId)
Static Public Member Functions inherited from QInputDevicePrivate
static void registerDevice (const QInputDevice *dev)
static void unregisterDevice (const QInputDevice *dev)
static bool isRegistered (const QInputDevice *dev)
static const QInputDevicefromId (qint64 systemId)
static QInputDevicePrivateget (QInputDevice *q)
static const QInputDevicePrivateget (const QInputDevice *q)
Static Public Member Functions inherited from QObjectPrivate
static bool removeConnection (Connection *c)
static QObjectPrivateget (QObject *o)
static const QObjectPrivateget (const QObject *o)
template<typename Func1, typename Func2>
static QMetaObject::Connection connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
template<typename Func1, typename Func2>
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot)
static QMetaObject::Connection connectImpl (const QObject *sender, int signal_index, const QObject *receiver, void **slot, QtPrivate::QSlotObjectBase *slotObj, int type, const int *types, const QMetaObject *senderMetaObject)
static QMetaObject::Connection connect (const QObject *sender, int signal_index, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type)
static QMetaObject::Connection connect (const QObject *sender, int signal_index, const QObject *receiver, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type)
static bool disconnect (const QObject *sender, int signal_index, void **slot)
static bool disconnect (const QObject *sender, int signal_index, const QObject *receiver, void **slot)

Public Attributes

EventPointMap activePoints
QPointingDeviceUniqueId uniqueId
quint32 toolId = 0
qint8 maximumTouchPoints = 0
qint8 buttonCount = 0
QPointingDevice::PointerType pointerType = QPointingDevice::PointerType::Unknown
bool toolProximity = false
Public Attributes inherited from QInputDevicePrivate
QString name
QString seatName
QString busId
QRect availableVirtualGeometry
voidqqExtra = nullptr
qint64 systemId = 0
QInputDevice::Capabilities capabilities = QInputDevice::Capability::None
QInputDevice::DeviceType deviceType = QInputDevice::DeviceType::Unknown
bool pointingDeviceType = false
Public Attributes inherited from QObjectPrivate
ExtraDataextraData
QAtomicPointer< QThreadDatathreadData
QAtomicPointer< ConnectionDataconnections
union { 
   QObject *   currentChildBeingDeleted 
   QAbstractDeclarativeData *   declarativeData 
}; 
QAtomicPointer< QtSharedPointer::ExternalRefCountDatasharedRefcount
Public Attributes inherited from QObjectData
QObjectq_ptr
QObjectparent
QObjectList children
uint isWidget: 1
uint blockSig: 1
uint wasDeleted: 1
uint isDeletingChildren: 1
uint sendChildEvents: 1
uint receiveChildEvents: 1
uint isWindow: 1
uint deleteLaterCalled: 1
uint isQuickItem: 1
uint willBeWidget: 1
uint wasWidget: 1
uint receiveParentEvents: 1
uint unused: 20
QAtomicInt postedEvents
QDynamicMetaObjectDatametaObject
QBindingStorage bindingStorage

Detailed Description

Definition at line 31 of file qpointingdevice_p.h.

Member Typedef Documentation

◆ EventPointMap

Constructor & Destructor Documentation

◆ QPointingDevicePrivate()

QPointingDevicePrivate::QPointingDevicePrivate ( const QString & name,
qint64 id,
QInputDevice::DeviceType type,
QPointingDevice::PointerType pType,
QPointingDevice::Capabilities caps,
int maxPoints,
int buttonCount,
const QString & seatName = QString(),
QPointingDeviceUniqueId uniqueId = QPointingDeviceUniqueId() )
inline

Definition at line 35 of file qpointingdevice_p.h.

◆ ~QPointingDevicePrivate()

QPointingDevicePrivate::~QPointingDevicePrivate ( )
overridedefault

Member Function Documentation

◆ addPassiveGrabber()

bool QPointingDevicePrivate::addPassiveGrabber ( const QPointerEvent * event,
const QEventPoint & point,
QObject * grabber )

Definition at line 546 of file qpointingdevice.cpp.

◆ clearPassiveGrabbers()

void QPointingDevicePrivate::clearPassiveGrabbers ( const QPointerEvent * event,
const QEventPoint & point )

Definition at line 601 of file qpointingdevice.cpp.

◆ firstActiveTarget()

QObject * QPointingDevicePrivate::firstActiveTarget ( ) const

Find the first non-null target (widget) via QMutableEventPoint::target() in the active points. This is the widget that will receive any event that comes from a touchpad, even if some of the touchpoints fall spatially on other windows.

Definition at line 465 of file qpointingdevice.cpp.

◆ firstActiveWindow()

QWindow * QPointingDevicePrivate::firstActiveWindow ( ) const

Find the first non-null QWindow instance via QMutableEventPoint::window() in the active points. This is the window that will receive any event that comes from a touchpad, even if some of the touchpoints fall spatially on other windows.

Definition at line 480 of file qpointingdevice.cpp.

◆ firstPointExclusiveGrabber()

QObject * QPointingDevicePrivate::firstPointExclusiveGrabber ( ) const

Return the exclusive grabber of the first point in activePoints. This is mainly for autotests that try to verify the "current" grabber outside the context of event delivery, which is something that the rest of the codebase should not be doing.

Definition at line 495 of file qpointingdevice.cpp.

◆ get() [1/2]

const QPointingDevicePrivate * QPointingDevicePrivate::get ( const QPointingDevice * q)
inlinestatic

Definition at line 92 of file qpointingdevice_p.h.

◆ get() [2/2]

QPointingDevicePrivate * QPointingDevicePrivate::get ( QPointingDevice * q)
inlinestatic

Definition at line 87 of file qpointingdevice_p.h.

◆ pointById()

QPointingDevicePrivate::EventPointData * QPointingDevicePrivate::pointById ( int id) const

Returns the active EventPointData instance with the given id, if available; if not, appends a new instance and returns it.

Definition at line 438 of file qpointingdevice.cpp.

◆ pointingDeviceById()

const QPointingDevice * QPointingDevicePrivate::pointingDeviceById ( qint64 systemId)
static

Finds the device instance identified by its systemId. Returns the device found, or nullptr if none was found.

Definition at line 381 of file qpointingdevice.cpp.

◆ queryPointById()

QPointingDevicePrivate::EventPointData * QPointingDevicePrivate::queryPointById ( int id) const

Returns the active EventPointData instance with the given id, if available, or nullptr if not.

Definition at line 426 of file qpointingdevice.cpp.

◆ queryTabletDevice()

const QPointingDevice * QPointingDevicePrivate::queryTabletDevice ( QInputDevice::DeviceType deviceType,
QPointingDevice::PointerType pointerType,
QPointingDeviceUniqueId uniqueId,
QInputDevice::Capabilities capabilities = QInputDevice::Capability::None,
qint64 systemId = 0 )
static

Finds the device instance belonging to the drawing or eraser end of a particular stylus, identified by its deviceType, pointerType, uniqueId and systemId. Returns the device found, or nullptr if none was found.

If systemId is 0, it's not significant for the search.

If an instance matching the given deviceType and pointerType but with only a default-constructed uniqueId is found, it will be assumed to be the one we're looking for, its uniqueId will be updated to match the given uniqueId, and its capabilities will be updated to match the given capabilities. This is for the benefit of any platform plugin that can discover the tablet itself at startup, along with the supported stylus types, but then discovers specific styli later on as they come into proximity.

Definition at line 348 of file qpointingdevice.cpp.

◆ removeExclusiveGrabber()

bool QPointingDevicePrivate::removeExclusiveGrabber ( const QPointerEvent * event,
const QObject * grabber )

Call QEventPoint::setExclusiveGrabber(nullptr) on each active point that has a grabber.

Definition at line 534 of file qpointingdevice.cpp.

◆ removeGrabber()

void QPointingDevicePrivate::removeGrabber ( QObject * grabber,
bool cancel = false )

Removes the given grabber as both passive and exclusive grabber from all points in activePoints where it's currently found. If cancel is true, the transition emitted from the grabChanged() signal will be CancelGrabExclusive or CancelGrabPassive. Otherwise it will be UngrabExclusive or UngrabPassive.

Note
This function provides a way to work around the limitation that we normally change grabbers only during event delivery; but it's also more expensive.

Definition at line 632 of file qpointingdevice.cpp.

◆ removePassiveGrabber()

bool QPointingDevicePrivate::removePassiveGrabber ( const QPointerEvent * event,
const QEventPoint & point,
QObject * grabber )

Definition at line 576 of file qpointingdevice.cpp.

◆ removePointById()

void QPointingDevicePrivate::removePointById ( int id)

Remove the active EventPointData instance with the given id.

Definition at line 453 of file qpointingdevice.cpp.

◆ sendTouchCancelEvent()

void QPointingDevicePrivate::sendTouchCancelEvent ( QTouchEvent * cancelEvent)

First, ensure that the cancelEvent's QTouchEvent::points() list contains all points that have exclusive grabs. Then send the event to each object that has an exclusive grab of any of the points.

Definition at line 401 of file qpointingdevice.cpp.

◆ setExclusiveGrabber()

void QPointingDevicePrivate::setExclusiveGrabber ( const QPointerEvent * event,
const QEventPoint & point,
QObject * exclusiveGrabber )

Definition at line 502 of file qpointingdevice.cpp.

◆ setPassiveGrabberContext()

bool QPointingDevicePrivate::setPassiveGrabberContext ( QPointingDevicePrivate::EventPointData * epd,
QObject * grabber,
QObject * context )
static

Definition at line 565 of file qpointingdevice.cpp.

◆ tabletDevice()

const QPointingDevice * QPointingDevicePrivate::tabletDevice ( QInputDevice::DeviceType deviceType,
QPointingDevice::PointerType pointerType,
QPointingDeviceUniqueId uniqueId )
static

Finds the device instance belonging to the drawing or eraser end of a particular stylus, identified by its deviceType, pointerType and uniqueId. If an existing device is not found, a new one is created and registered, with a warning.

This function is called from QWindowSystemInterface. Platform plugins should use \l queryTabletDeviceInstance() to check whether a tablet stylus coming into proximity is previously known; if not known, the plugin should create and register the stylus.

Definition at line 673 of file qpointingdevice.cpp.

Member Data Documentation

◆ activePoints

EventPointMap QPointingDevicePrivate::activePoints
mutable

Definition at line 78 of file qpointingdevice_p.h.

◆ buttonCount

qint8 QPointingDevicePrivate::buttonCount = 0

Definition at line 83 of file qpointingdevice_p.h.

◆ maximumTouchPoints

qint8 QPointingDevicePrivate::maximumTouchPoints = 0

Definition at line 82 of file qpointingdevice_p.h.

◆ pointerType

Definition at line 84 of file qpointingdevice_p.h.

◆ toolId

quint32 QPointingDevicePrivate::toolId = 0

Definition at line 81 of file qpointingdevice_p.h.

◆ toolProximity

bool QPointingDevicePrivate::toolProximity = false

Definition at line 85 of file qpointingdevice_p.h.

◆ uniqueId

QPointingDeviceUniqueId QPointingDevicePrivate::uniqueId

Definition at line 80 of file qpointingdevice_p.h.


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