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
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)
 
- Public Member Functions inherited from QObjectPrivate
void ensureExtraData ()
 
 QObjectPrivate (int version=QObjectPrivateVersion)
 
virtual ~QObjectPrivate ()
 
void deleteChildren ()
 
void clearBindingStorage ()
 
void checkForIncompatibleLibraryVersion (int version) const
 
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
 
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.

References emit, QPointingDevice::GrabPassive, QEventPoint::id, Q_UNLIKELY, qCDebug, queryPointById(), qWarning, and QEventPoint::state.

+ Here is the call graph for this function:

◆ clearPassiveGrabbers()

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

Definition at line 601 of file qpointingdevice.cpp.

References emit, QEventPoint::id, Q_UNLIKELY, qCDebug, queryPointById(), qWarning, QEventPoint::state, and QPointingDevice::UngrabPassive.

+ Here is the call graph for this function:

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

References activePoints, and QMutableEventPoint::target().

+ Here is the call graph for this function:

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

References activePoints, window(), and QMutableEventPoint::window().

+ Here is the call graph for this function:

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

References activePoints.

◆ get() [1/2]

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

Definition at line 92 of file qpointingdevice_p.h.

References QObjectPrivate::get().

+ Here is the call graph for this function:

◆ get() [2/2]

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

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

References activePoints, and it.

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

References QInputDevice::devices(), get(), QInputDevice::Keyboard, and QInputDevicePrivate::systemId.

Referenced by QNSView(Mouse)::initMouse.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

References activePoints, and it.

Referenced by addPassiveGrabber(), clearPassiveGrabbers(), removePassiveGrabber(), and setExclusiveGrabber().

+ Here is the caller graph for this function:

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

References QInputDevice::Airbrush, QInputDevicePrivate::capabilities, QInputDevice::devices(), QInputDevicePrivate::deviceType, get(), QPointingDeviceUniqueId::numericId, pointerType, QInputDevice::Puck, qCDebug, QInputDevicePrivate::systemId, and uniqueId.

Referenced by tabletDevice().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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

References activePoints, ret, and setExclusiveGrabber().

+ Here is the call graph for this function:

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

References activePoints, cancel(), QPointingDevice::CancelGrabExclusive, QPointingDevice::CancelGrabPassive, emit, Q_ASSERT, qCDebug, QPointingDevice::UngrabExclusive, and QPointingDevice::UngrabPassive.

+ Here is the call graph for this function:

◆ removePassiveGrabber()

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

Definition at line 576 of file qpointingdevice.cpp.

References emit, i, QEventPoint::id, Q_ASSERT, Q_UNLIKELY, qCDebug, queryPointById(), qWarning, QEventPoint::state, and QPointingDevice::UngrabPassive.

+ Here is the call graph for this function:

◆ removePointById()

void QPointingDevicePrivate::removePointById ( int id)

Remove the active EventPointData instance with the given id.

Definition at line 453 of file qpointingdevice.cpp.

References activePoints.

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

References activePoints, QMutableTouchEvent::from(), and QCoreApplication::sendEvent().

+ Here is the call graph for this function:

◆ setExclusiveGrabber()

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

Definition at line 502 of file qpointingdevice.cpp.

References QPointingDevice::CancelGrabExclusive, emit, QEventPoint::globalPosition, QPointingDevice::GrabExclusive, QEventPoint::id, Q_ASSERT, Q_UNLIKELY, qCDebug, queryPointById(), qWarning, QEventPoint::scenePosition, QEventPoint::state, and QPointingDevice::UngrabExclusive.

Referenced by removeExclusiveGrabber().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setPassiveGrabberContext()

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

Definition at line 565 of file qpointingdevice.cpp.

References context, and i.

Referenced by QQuickDeliveryAgentPrivate::onGrabChanged().

+ Here is the caller graph for this function:

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

References QInputDevicePrivate::deviceType, Qt::hex(), QCoreApplication::instance(), QPointingDeviceUniqueId::numericId, pointerType, QInputDevice::Position, QInputDevice::Pressure, qCDebug, queryTabletDevice(), QInputDevicePrivate::registerDevice(), and uniqueId.

Referenced by QWindowSystemInterface::handleTabletEnterProximityEvent(), QWindowSystemInterface::handleTabletEvent(), and QWindowSystemInterface::handleTabletLeaveProximityEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ activePoints

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

Referenced by queryTabletDevice(), and tabletDevice().

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

Referenced by queryTabletDevice(), and tabletDevice().


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