![]() |
Qt 6.x
The Qt SDK
|
#include <qpointingdevice_p.h>
Classes | |
struct | EventPointData |
Public Types | |
using | EventPointMap = QVarLengthFlatMap< int, EventPointData, 20 > |
![]() | |
typedef void(* | StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **) |
using | ConnectionDataPointer = QExplicitlySharedDataPointer< ConnectionData > |
Definition at line 29 of file qpointingdevice_p.h.
using QPointingDevicePrivate::EventPointMap = QVarLengthFlatMap<int, EventPointData, 20> |
Definition at line 75 of file qpointingdevice_p.h.
|
inline |
Definition at line 33 of file qpointingdevice_p.h.
|
overridedefault |
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.
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.
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, QMutableEventPoint::target(), and QFlatMap< Key, T, Compare, KeyContainer, MappedContainer >::values().
Referenced by QApplicationPrivate::translateRawTouchEvent().
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, QFlatMap< Key, T, Compare, KeyContainer, MappedContainer >::values(), window(), and QMutableEventPoint::window().
Referenced by QGuiApplicationPrivate::processTouchEvent().
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, QFlatMap< Key, T, Compare, KeyContainer, MappedContainer >::isEmpty(), and QFlatMap< Key, T, Compare, KeyContainer, MappedContainer >::values().
|
inlinestatic |
Definition at line 90 of file qpointingdevice_p.h.
References QObjectPrivate::get().
|
inlinestatic |
Definition at line 85 of file qpointingdevice_p.h.
References QObjectPrivate::get().
Referenced by QtWaylandClient::QWaylandTabletV2::QWaylandTabletV2(), QPointerEvent::addPassiveGrabber(), QPointerEvent::clearPassiveGrabbers(), QApplicationPrivate::closePopup(), QQuickDeliveryAgentPrivate::deliverPressOrReleaseEvent(), QQuickDeliveryAgentPrivate::deliverTouchCancelEvent(), QQuickDeliveryAgentPrivate::deliverUpdatedPoints(), QQuickWindow::event(), QPointerEvent::exclusiveGrabber(), QApplicationPrivate::findClosestTouchPointTarget(), QQuickMultiPointTouchArea::grabGesture(), QQuickDeliveryAgentPrivate::handleWindowDeactivate(), QNSView(Mouse)::initMouse, QQuickDeliveryAgentPrivate::mousePointData(), QQuickDeliveryAgentPrivate::onGrabChanged(), QPointerEvent::passiveGrabbers(), pointingDeviceById(), QGuiApplicationPrivate::processEnterEvent(), QGuiApplicationPrivate::processMouseEvent(), QGuiApplicationPrivate::processTouchEvent(), queryTabletDevice(), QLibInputTouch::registerDevice(), QQuickDeliveryAgentPrivate::removeGrabber(), QPointerEvent::removePassiveGrabber(), QPointerEvent::setExclusiveGrabber(), QMutableEventPoint::setTimestamp(), QApplicationPrivate::translateRawTouchEvent(), QApplicationPrivate::translateTouchCancel(), QtWaylandClient::QWaylandTabletPadV2::zwp_tablet_pad_v2_buttons(), QtWaylandClient::QWaylandTabletPadV2::zwp_tablet_pad_v2_path(), QtWaylandClient::QWaylandTabletSeatV2::zwp_tablet_seat_v2_pad_added(), QtWaylandClient::QWaylandTabletSeatV2::zwp_tablet_seat_v2_tool_added(), QtWaylandClient::QWaylandTabletToolV2::zwp_tablet_tool_v2_button(), QtWaylandClient::QWaylandTabletToolV2::zwp_tablet_tool_v2_capability(), QtWaylandClient::QWaylandTabletToolV2::zwp_tablet_tool_v2_hardware_id_wacom(), QtWaylandClient::QWaylandTabletToolV2::zwp_tablet_tool_v2_hardware_serial(), QtWaylandClient::QWaylandTabletToolV2::zwp_tablet_tool_v2_type(), QtWaylandClient::QWaylandTabletV2::zwp_tablet_v2_id(), QtWaylandClient::QWaylandTabletV2::zwp_tablet_v2_name(), and QtWaylandClient::QWaylandTabletV2::zwp_tablet_v2_path().
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, it, and QFlatMap< Key, T, Compare, KeyContainer, MappedContainer >::try_emplace().
Referenced by QGuiApplicationPrivate::processMouseEvent(), QGuiApplicationPrivate::processTouchEvent(), and QMutableEventPoint::setTimestamp().
|
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.
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, QFlatMap< Key, T, Compare, KeyContainer, MappedContainer >::end(), QFlatMap< Key, T, Compare, KeyContainer, MappedContainer >::find(), and it.
Referenced by addPassiveGrabber(), clearPassiveGrabbers(), QQuickDeliveryAgentPrivate::deliverUpdatedPoints(), QQuickWindow::event(), QPointerEvent::exclusiveGrabber(), QQuickMultiPointTouchArea::grabGesture(), QQuickDeliveryAgentPrivate::onGrabChanged(), QPointerEvent::passiveGrabbers(), QGuiApplicationPrivate::processEnterEvent(), QGuiApplicationPrivate::processMouseEvent(), removePassiveGrabber(), and setExclusiveGrabber().
|
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().
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, setExclusiveGrabber(), and QFlatMap< Key, T, Compare, KeyContainer, MappedContainer >::values().
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
.
Definition at line 632 of file qpointingdevice.cpp.
References activePoints, cancel(), QPointingDevice::CancelGrabExclusive, QPointingDevice::CancelGrabPassive, emit, pi, Q_ASSERT, qCDebug, QPointingDevice::UngrabExclusive, and QPointingDevice::UngrabPassive.
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.
void QPointingDevicePrivate::removePointById | ( | int | id | ) |
Remove the active EventPointData instance with the given id.
Definition at line 453 of file qpointingdevice.cpp.
References activePoints, and QFlatMap< Key, T, Compare, KeyContainer, MappedContainer >::remove().
Referenced by QGuiApplicationPrivate::processTouchEvent().
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::addPoint(), QPointerEvent::clearPassiveGrabbers(), QMutableTouchEvent::from(), QList< T >::isEmpty(), QPointerEvent::points(), QCoreApplication::sendEvent(), QPointerEvent::setExclusiveGrabber(), and QFlatMap< Key, T, Compare, KeyContainer, MappedContainer >::values().
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().
|
static |
Definition at line 565 of file qpointingdevice.cpp.
References context, i, QListSpecialMethodsBase< T >::indexOf(), QPointingDevicePrivate::EventPointData::passiveGrabbers, QPointingDevicePrivate::EventPointData::passiveGrabbersContext, QList< T >::resize(), and QList< T >::size().
Referenced by QQuickDeliveryAgentPrivate::onGrabChanged().
|
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().
|
mutable |
Definition at line 76 of file qpointingdevice_p.h.
Referenced by QApplicationPrivate::findClosestTouchPointTarget(), firstActiveTarget(), firstActiveWindow(), firstPointExclusiveGrabber(), pointById(), QGuiApplicationPrivate::processTouchEvent(), queryPointById(), removeExclusiveGrabber(), removeGrabber(), removePointById(), sendTouchCancelEvent(), and QApplicationPrivate::translateTouchCancel().
qint8 QPointingDevicePrivate::buttonCount = 0 |
Definition at line 81 of file qpointingdevice_p.h.
qint8 QPointingDevicePrivate::maximumTouchPoints = 0 |
Definition at line 80 of file qpointingdevice_p.h.
QPointingDevice::PointerType QPointingDevicePrivate::pointerType = QPointingDevice::PointerType::Unknown |
Definition at line 82 of file qpointingdevice_p.h.
Referenced by queryTabletDevice(), and tabletDevice().
quint32 QPointingDevicePrivate::toolId = 0 |
Definition at line 79 of file qpointingdevice_p.h.
bool QPointingDevicePrivate::toolProximity = false |
Definition at line 83 of file qpointingdevice_p.h.
QPointingDeviceUniqueId QPointingDevicePrivate::uniqueId |
Definition at line 78 of file qpointingdevice_p.h.
Referenced by queryTabletDevice(), and tabletDevice().