![]() |
Qt 6.x
The Qt SDK
|
#include <qquickdeliveryagent_p_p.h>
Public Types | |
enum | FocusOption { DontChangeFocusProperty = 0x01 , DontChangeSubFocusItem = 0x02 } |
![]() | |
typedef void(* | StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **) |
using | ConnectionDataPointer = QExplicitlySharedDataPointer< ConnectionData > |
Static Public Member Functions | |
static void | notifyFocusChangesRecur (QQuickItem **item, int remaining, Qt::FocusReason reason) |
static QQuickDeliveryAgent * | currentOrItemDeliveryAgent (const QQuickItem *item) |
static QPointerEvent * | clonePointerEvent (QPointerEvent *event, std::optional< QPointF > transformedLocalPos=std::nullopt) |
static void | localizePointerEvent (QPointerEvent *ev, const QQuickItem *dest) |
static bool | anyPointGrabbed (const QPointerEvent *ev) |
static bool | allPointsGrabbed (const QPointerEvent *ev) |
static bool | isMouseEvent (const QPointerEvent *ev) |
static bool | isMouseOrWheelEvent (const QPointerEvent *ev) |
static bool | isHoverEvent (const QPointerEvent *ev) |
static bool | isTouchEvent (const QPointerEvent *ev) |
static bool | isTabletEvent (const QPointerEvent *ev) |
static bool | isEventFromMouseOrTouchpad (const QPointerEvent *ev) |
static bool | isSynthMouse (const QPointerEvent *ev) |
static QQuickPointingDeviceExtra * | deviceExtra (const QInputDevice *device) |
static bool | dragOverThreshold (qreal d, Qt::Axis axis, QMouseEvent *event, int startDragThreshold=-1) |
static bool | dragOverThreshold (qreal d, Qt::Axis axis, const QEventPoint &tp, int startDragThreshold=-1) |
static bool | dragOverThreshold (QVector2D delta) |
![]() | |
static bool | removeConnection (Connection *c) |
static QObjectPrivate * | get (QObject *o) |
static const QObjectPrivate * | get (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) |
Static Public Attributes | |
static bool | subsceneAgentsExist |
static QQuickDeliveryAgent * | currentEventDeliveryAgent |
Definition at line 43 of file qquickdeliveryagent_p_p.h.
Enumerator | |
---|---|
DontChangeFocusProperty | |
DontChangeSubFocusItem |
Definition at line 56 of file qquickdeliveryagent_p_p.h.
QQuickDeliveryAgentPrivate::QQuickDeliveryAgentPrivate | ( | QQuickItem * | root | ) |
Definition at line 885 of file qquickdeliveryagent.cpp.
References isSubsceneAgent, and subsceneAgentsExist.
QQuickDeliveryAgentPrivate::~QQuickDeliveryAgentPrivate | ( | ) |
Definition at line 898 of file qquickdeliveryagent.cpp.
References sceneTransform.
|
static |
Definition at line 1396 of file qquickdeliveryagent.cpp.
References QPointerEvent::exclusiveGrabber(), QList< T >::isEmpty(), QPointerEvent::passiveGrabbers(), and QPointerEvent::points().
Referenced by deliverUpdatedPoints().
bool QQuickDeliveryAgentPrivate::allUpdatedPointsAccepted | ( | const QPointerEvent * | ev | ) |
Definition at line 1350 of file qquickdeliveryagent.cpp.
References QPointerEvent::points(), and QEventPoint::Pressed.
Referenced by deliverPointerEvent().
|
static |
Definition at line 1387 of file qquickdeliveryagent.cpp.
References QPointerEvent::exclusiveGrabber(), QList< T >::isEmpty(), QPointerEvent::passiveGrabbers(), and QPointerEvent::points().
void QQuickDeliveryAgentPrivate::cancelTouchMouseSynthesis | ( | ) |
Definition at line 127 of file qquickdeliveryagent.cpp.
References qCDebug, touchMouseDevice, and touchMouseId.
Referenced by deliverPointerEvent(), deliverPressOrReleaseEvent(), deliverTouchAsMouse(), deliverTouchCancelEvent(), and sendFilteredPointerEventImpl().
bool QQuickDeliveryAgentPrivate::checkIfDoubleTapped | ( | ulong | newPressEventTimestamp, |
QPoint | newPressPos | ||
) |
Definition at line 73 of file qquickdeliveryagent.cpp.
References qAbs(), QGuiApplication::styleHints(), QStyleHints::touchDoubleTapDistance, touchMousePressPos, touchMousePressTimestamp, QPoint::x(), and QPoint::y().
Referenced by deliverTouchAsMouse().
void QQuickDeliveryAgentPrivate::clearFocusInScope | ( | QQuickItem * | scope, |
QQuickItem * | item, | ||
Qt::FocusReason | reason, | ||
FocusOptions | options = { } |
||
) |
Definition at line 466 of file qquickdeliveryagent.cpp.
References QQuickItemPrivate::activeFocus, activeFocusItem, clearFocusInScope(), QInputMethod::commit(), QVarLengthArray< T, Prealloc >::data(), QQuickWindowPrivate::deliveryAgent, QQuickWindowPrivate::deliveryAgentPrivate(), DontChangeFocusProperty, DontChangeSubFocusItem, emit, QQuickItemPrivate::Focus, QEvent::FocusIn, QWindow::focusObjectChanged(), QEvent::FocusOut, QQuickItemPrivate::get(), QQuickWindowPrivate::get(), QGuiApplication::inputMethod(), QVarLengthArray< T, Prealloc >::isEmpty(), isSubsceneAgent, item, QQuickItemChangeListener::itemFocusChanged(), lastFocusReason, notifyFocusChangesRecur(), QQuickItem::parentItem(), priv(), Q_ASSERT, qCDebug, rootItem, QCoreApplication::sendEvent(), QVLABaseBase::size(), QQuickItemPrivate::subFocusItem, updateFocusItemTransform(), QQuickItemPrivate::updateSubFocusItem(), and QQuickItem::window().
Referenced by clearFocusInScope(), clearFocusObject(), QQuickTableViewPrivate::releaseItem(), and QQuickItemPrivate::setEffectiveEnableRecur().
void QQuickDeliveryAgentPrivate::clearFocusObject | ( | ) |
Definition at line 566 of file qquickdeliveryagent.cpp.
References activeFocusItem, clearFocusInScope(), QQuickItemPrivate::get(), Qt::OtherFocusReason, and rootItem.
bool QQuickDeliveryAgentPrivate::clearHover | ( | ulong | timestamp = 0 | ) |
Definition at line 599 of file qquickdeliveryagent.cpp.
References QFlatMap< Key, T, Compare, KeyContainer, MappedContainer >::clear(), clearHover(), deliverHoverEventToItem(), hoverItems, QFlatMap< Key, T, Compare, KeyContainer, MappedContainer >::isEmpty(), item, QGuiApplication::keyboardModifiers(), QGuiApplicationPrivate::lastCursorPosition, rootItem, window(), and QQuickItem::window().
Referenced by clearHover(), deliverHoverEvent(), deliverHoverEventToItem(), and handleWindowHidden().
|
static |
Make a copy of any type of QPointerEvent, and optionally localize it by setting its first point's local position() if transformedLocalPos is given.
Definition at line 914 of file qquickdeliveryagent.cpp.
References QMutableEventPoint::detach(), ret, QMutableEventPoint::setTimestamp(), and QEventPoint::timestamp.
Referenced by QQuickFlickablePrivate::captureDelayedPress(), QQuickFlickable::filterPointerEvent(), and QQuickFlickable::touchEvent().
bool QQuickDeliveryAgentPrivate::compressTouchEvent | ( | QTouchEvent * | event | ) |
This function is called from handleTouchEvent() in case a series of touch events containing only Updated
and Stationary
points arrives within a short period of time. (Some touchscreens are more "jittery" than others.)
It would be a waste of CPU time to deliver events and have items in the scene getting modified more often than once per frame; so here we try to coalesce the series of updates into a single event containing all updates that occur within one frame period, and deliverDelayedTouchEvent() is called from flushFrameSynchronousEvents() to send that single event. This is the reason why touch compression lives here so far, instead of in a lower layer: the render loop updates the scene in sync with the screen's vsync, and flushFrameSynchronousEvents() is called from there (for example from QSGThreadedRenderLoop::polishAndSync(), and equivalent places in other render loops). It would be preferable to move this code down to a lower level eventually, though, because it's not fundamentally a Qt Quick concern.
This optimization can be turned off by setting the environment variable QML_NO_TOUCH_COMPRESSION
.
Returns true
if "done", false
if the caller needs to finish the event delivery.
Definition at line 1512 of file qquickdeliveryagent.cpp.
References compressedTouchCount, delayedTouch, deliverDelayedTouchEvent(), QMutableEventPoint::detach(), i, isSubsceneAgent, QEventPoint::Pressed, qCDebug, QEventPoint::Released, rootItem, QEventPoint::Stationary, QEventPoint::Updated, window(), and QQuickItem::window().
Referenced by handleTouchEvent().
|
static |
If called during event delivery, returns the agent that is delivering the event, without checking whether item is reachable from there. Otherwise returns QQuickItemPrivate::deliveryAgent() (the delivery agent for the narrowest subscene containing item), or null
if item is null
.
Definition at line 641 of file qquickdeliveryagent.cpp.
References currentEventDeliveryAgent, QQuickItemPrivate::deliveryAgent(), QQuickItemPrivate::get(), and item.
Referenced by QQuickPointerHandler::setPassiveGrab().
void QQuickDeliveryAgentPrivate::deliverDelayedTouchEvent | ( | ) |
Definition at line 1291 of file qquickdeliveryagent.cpp.
References compressedTouchCount, delayedTouch, deliverPointerEvent(), e, and qCDebug.
Referenced by compressTouchEvent(), QQuickTouchUtils::flush(), flushFrameSynchronousEvents(), and handleTouchEvent().
bool QQuickDeliveryAgentPrivate::deliverHoverEvent | ( | const QPointF & | scenePos, |
const QPointF & | lastScenePos, | ||
Qt::KeyboardModifiers | modifiers, | ||
ulong | timestamp | ||
) |
Delivers a hover event at scenePos to the whole scene or subscene that this DeliveryAgent is responsible for. Returns true
if delivery is "done".
Definition at line 1005 of file qquickdeliveryagent.cpp.
References QFlatMap< Key, T, Compare, KeyContainer, MappedContainer >::begin(), clearHover(), currentHoverId, QGraphicsItem::data(), deliverHoverEventRecursive(), deliverHoverEventToItem(), QFlatMap< Key, T, Compare, KeyContainer, MappedContainer >::end(), QFlatMap< Key, T, Compare, KeyContainer, MappedContainer >::erase(), QQuickItemPrivate::get(), hoveredLeafItemFound, hoverItems, QFlatMap< Key, T, Compare, KeyContainer, MappedContainer >::isEmpty(), it, item, rootItem, and QQuickItemPrivate::subtreeHoverEnabled.
Referenced by deliverTouchAsMouse(), flushFrameSynchronousEvents(), handleMouseEvent(), and QQuickMouseArea::itemChange().
bool QQuickDeliveryAgentPrivate::deliverHoverEventRecursive | ( | QQuickItem * | item, |
const QPointF & | scenePos, | ||
const QPointF & | lastScenePos, | ||
Qt::KeyboardModifiers | modifiers, | ||
ulong | timestamp | ||
) |
Delivers a hover event at scenePos to item and all its children. The children get it first. As soon as any item allows the event to remain accepted, recursion stops. Returns true
in that case, or false
if the event is rejected.
Each item that has hover enabled (from setAcceptHoverEvents()) has the QQuickItemPrivate::hoverEnabled flag set. This only controls whether we should send hover events to the item itself. (HoverHandlers no longer set this flag.) When an item has hoverEnabled set, all its ancestors have the QQuickItemPrivate::subtreeHoverEnabled set. This function will follow the subtrees that have subtreeHoverEnabled by recursing into each child with that flag set. And for each child (in addition to the item itself) that also has hoverEnabled set, we call deliverHoverEventToItem() to actually deliver the event to it. The item can then choose to accept or reject the event. This is only for control over whether we stop propagation or not: an item can reject the event, but at the same time be hovered (and therefore in hoverItems). By accepting the event, the item will effectivly end up as the only one hovered. Any other HoverHandler that may be a child of an item that is stacked underneath, will not. Note that since siblings can overlap, there can be more than one leaf item under the mouse.
Note that HoverHandler doesn't set the hoverEnabled flag on the parent item. But still, adding a HoverHandler to an item will set its subtreeHoverEnabled flag. So all the propagation logic described above will otherwise be the same. But the hoverEnabled flag can be used to resolve if subtreeHoverEnabled is on because the application explicitly requested it (setAcceptHoverEvents()), or indirectly, because the item has HoverHandlers.
For legacy reasons (Qt 6.1), as soon as we find a leaf item that has hover enabled, and therefore receives the event, we stop recursing into the remaining siblings (even if the event was ignored). This means that we only allow hover events to propagate up the direct parent-child hierarchy, and not to siblings. However, if the first candidate HoverHandler is disabled, delivery continues to the next one, which may be a sibling (QTBUG-106548).
Definition at line 1097 of file qquickdeliveryagent.cpp.
References QList< T >::at(), child, QObjectData::children, QQuickItemPrivate::culled, deliverHoverEventRecursive(), deliverHoverEventToItem(), QQuickItemPrivate::flags, QQuickItemPrivate::get(), hoveredLeafItemFound, item, QQuickItem::ItemClipsChildrenToShape, QQuickItemPrivate::paintOrderChildItems(), QList< T >::size(), and QQuickItemPrivate::subtreeHoverEnabled.
Referenced by deliverHoverEvent(), and deliverHoverEventRecursive().
bool QQuickDeliveryAgentPrivate::deliverHoverEventToItem | ( | QQuickItem * | item, |
const QPointF & | scenePos, | ||
const QPointF & | lastScenePos, | ||
Qt::KeyboardModifiers | modifiers, | ||
ulong | timestamp, | ||
bool | clearHover | ||
) |
Delivers a hover event at scenePos to item and its HoverHandlers if any. Returns true
if the event remains accepted, false
if rejected.
If clearHover is true
, it will be sent as a QEvent::HoverLeave event, and the item and its handlers are expected to transition into their non-hovered states even if the position still indicates that the mouse is inside.
Definition at line 1147 of file qquickdeliveryagent.cpp.
References clearHover(), QFlatMap< Key, T, Compare, KeyContainer, MappedContainer >::contains(), QGraphicsItem::contains(), currentHoverId, QQuickItemPrivate::extra, QQuickItemPrivate::get(), QQuickItemPrivate::hasPointerHandlers(), hoveredLeafItemFound, QQuickItemPrivate::hoverEnabled, QEvent::HoverEnter, hoverItems, QEvent::HoverLeave, QEvent::HoverMove, item, QGraphicsItem::mapFromScene(), QEvent::MouseMove, Qt::NoButton, qCDebug, QCoreApplication::sendEvent(), sendHoverEvent(), QPointerEvent::setAccepted(), and QPointerEvent::setTimestamp().
Referenced by clearHover(), deliverHoverEvent(), and deliverHoverEventRecursive().
Definition at line 855 of file qquickdeliveryagent.cpp.
References e, item, QEvent::KeyPress, QEvent::KeyRelease, QGraphicsItem::parentItem(), Q_QUICK_INPUT_PROFILE, qt_sendShortcutOverrideEvent(), and QCoreApplication::sendEvent().
void QQuickDeliveryAgentPrivate::deliverMatchingPointsToItem | ( | QQuickItem * | item, |
bool | isGrabber, | ||
QPointerEvent * | pointerEvent, | ||
bool | handlersOnly = false |
||
) |
Deliver pointerEvent to item and its handlers, if any. If handlersOnly is true
, skip QQuickItem::event() and just visit its handlers via QQuickItemPrivate::handlePointerEvent().
This function exists just to de-duplicate the common code between deliverPressOrReleaseEvent() and deliverUpdatedPoints().
Definition at line 2221 of file qquickdeliveryagent.cpp.
References Qt::AA_SynthesizeMouseForUnhandledTouchEvents, QEvent::accept(), QGraphicsItem::acceptedMouseButtons(), QQuickItemPrivate::acceptedMouseButtons(), QGraphicsItem::acceptTouchEvents(), button, contains(), deliverTouchAsMouse(), QQuickItemPrivate::deliveryAgent(), QPointerEvent::exclusiveGrabber(), exclusiveGrabbers(), QQuickItemPrivate::get(), QQuickItemPrivate::handlePointerEvent(), Qt::hex(), i, QEvent::isAccepted(), QPointerEvent::isBeginEvent(), QGraphicsItem::isEnabled(), QPointerEvent::isEndEvent(), isMouseEvent(), isTouchEvent(), QPointerEvent::isUpdateEvent(), QGraphicsItem::isVisible(), item, lastUngrabbed, Qt::LeftButton, QQuickItemPrivate::localizedTouchEvent(), localizePointerEvent(), QEvent::MouseButtonDblClick, Qt::NoButton, QEvent::None, QTest::QTouchEventSequence::point(), QPointerEvent::point(), QTest::QTouchEventSequence::points, QEventPoint::Pressed, Q_ASSERT, Q_LIKELY, qCDebug, QCoreApplication::sendEvent(), sendFilteredPointerEvent(), QEventPoint::setAccepted(), QPointerEvent::setExclusiveGrabber(), QCoreApplication::testAttribute(), QEvent::type(), and QObjectData::wasDeleted.
Referenced by deliverPressOrReleaseEvent(), and deliverUpdatedPoints().
void QQuickDeliveryAgentPrivate::deliverPointerEvent | ( | QPointerEvent * | event | ) |
The entry point for delivery of event after determining that it is a pointer event, and either does not need to be coalesced in compressTouchEvent(), or already has been.
When it returns, event delivery is done.
Definition at line 1866 of file qquickdeliveryagent.cpp.
References allUpdatedPointsAccepted(), QVarLengthArray< T, Prealloc >::at(), cancelTouchMouseSynthesis(), deliverPressOrReleaseEvent(), deliverUpdatedPoints(), QQuickPointerHandlerPrivate::deviceDeliveryTargets(), ensureDeviceConnected(), eventsInDelivery, i, isSubsceneAgent, isTabletEvent(), isTouchEvent(), lastUngrabbed, QQuickDeliveryAgent::Transform::map(), pointerEventRecursionGuard, QStack< T >::pop(), QStack< T >::push(), qCDebug, QEventPoint::Released, QVarLengthArray< T, Prealloc >::resize(), sceneTransform, skipDelivery, and touchMouseId.
Referenced by deliverDelayedTouchEvent(), handleMouseEvent(), and handleTouchEvent().
bool QQuickDeliveryAgentPrivate::deliverPressOrReleaseEvent | ( | QPointerEvent * | event, |
bool | handlersOnly = false |
||
) |
Deliver a pointer event containing newly pressed or released QEventPoints. If handlersOnly is true
, skip the items and just deliver to Pointer Handlers (via QQuickItemPrivate::handlePointerEvent()).
For the sake of determinism, this function first builds the list targetItems
by calling pointerTargets() on the root item. That is, the list of items to "visit" is determined at the beginning, and will not be affected if items reparent, hide, or otherwise try to make themselves eligible or ineligible during delivery. (Avoid bugs due to ugly just-in-time tricks in JS event handlers, filters etc.)
Whenever a touch gesture is in progress, and another touchpoint is pressed, or an existing touchpoint is released, we "start over" with delivery: that's why this function is called whenever the event contains newly pressed or released points. It's not necessary for a handler or an item to greedily grab all touchpoints just in case a valid gesture might start. QQuickMultiPointHandler::wantsPointerEvent() can calmly return false
if the number of points is less than QQuickMultiPointHandler::minimumPointCount(), because it knows it will be asked again if the number of points increases.
When handlersOnly is false
, event visits the items in targetItems
via QQuickItem::event(). We have to call sendFilteredPointerEvent() before visiting each item, just in case a Flickable (or some other parent-filter) will decide to intercept the event. But we also have to be very careful never to let the same Flickable filter the same event twice, because when Flickable decides to intercept, it lets the child item have that event, and then grabs the next event. That allows you to drag a Slider, DragHandler or whatever inside a ListView delegate: if you're dragging in the correct direction for the draggable child, it can use QQuickItem::setKeepMouseGrab(), QQuickItem::setKeepTouchGrab() or QQuickPointerHandler::grabPermissions() to prevent Flickable from intercepting during filtering, only if it actually has the exclusive grab already when Flickable attempts to take it. Typically, both the Flickable and the child are checking the same drag threshold, so the child must have a chance to grab and keep the grab before Flickable gets a chance to steal it, even though Flickable actually sees the event first during filtering.
Definition at line 2152 of file qquickdeliveryagent.cpp.
References cancelTouchMouseSynthesis(), deliverMatchingPointsToItem(), QPointingDevicePrivate::get(), QQuickItemPrivate::get(), hasFiltered, Qt::hex(), i, isDeliveringTouchAsMouse(), isSubsceneAgent, isTouchEvent(), item, QQuickItemPrivate::maybeHasSubsceneDeliveryAgent, mergePointerTargets(), pointerTargets(), qCWarning, rootItem, sendFilteredPointerEvent(), QList< T >::size(), skipDelivery, touchMouseDevice, and touchMouseId.
Referenced by deliverPointerEvent().
bool QQuickDeliveryAgentPrivate::deliverSinglePointEventUntilAccepted | ( | QPointerEvent * | event | ) |
Definition at line 1235 of file qquickdeliveryagent.cpp.
References QListSpecialMethodsBase< T >::contains(), QQuickPointerHandlerPrivate::deviceDeliveryTargets(), QQuickItemPrivate::get(), QQuickItemPrivate::handlePointerEvent(), QEventPoint::isAccepted(), item, localizePointerEvent(), pointerTargets(), Q_ASSERT, qCDebug, qobject_cast< QQuickItem * >(), rootItem, QCoreApplication::sendEvent(), and QEventPoint::setAccepted().
void QQuickDeliveryAgentPrivate::deliverToPassiveGrabbers | ( | const QVector< QPointer< QObject > > & | passiveGrabbers, |
QPointerEvent * | pointerEvent | ||
) |
Definition at line 926 of file qquickdeliveryagent.cpp.
References QEvent::accept(), QVarLengthArray< T, Prealloc >::begin(), QListSpecialMethodsBase< T >::contains(), QInputEvent::device(), QQuickPointerHandlerPrivate::deviceDeliveryTargets(), QVarLengthArray< T, Prealloc >::end(), QPointerEvent::exclusiveGrabber(), hasFiltered, isMouseEvent(), isTouchEvent(), it, localizePointerEvent(), QQuickItem::parentItem(), QPointerEvent::point(), Q_UNLIKELY, qMakePair(), QCoreApplication::sendEvent(), and sendFilteredPointerEvent().
Referenced by deliverUpdatedPoints().
bool QQuickDeliveryAgentPrivate::deliverTouchAsMouse | ( | QQuickItem * | item, |
QTouchEvent * | pointerEvent | ||
) |
Definition at line 134 of file qquickdeliveryagent.cpp.
References Qt::AA_SynthesizeMouseForUnhandledTouchEvents, QGraphicsItem::acceptHoverEvents(), cancelTouchMouseSynthesis(), checkIfDoubleTapped(), QGraphicsItem::contains(), deliverHoverEvent(), device, QPointerEvent::exclusiveGrabber(), QQuickItemPrivate::get(), Qt::hex(), QEvent::isAccepted(), QPointF::isNull(), item, QGuiApplicationPrivate::lastCursorPosition, lastMousePosition, QQuickItemPrivate::localizedTouchEvent(), QGraphicsItem::mapFromScene(), QInputEvent::modifiers(), QEvent::MouseButtonDblClick, QEvent::MouseButtonPress, QEvent::MouseButtonRelease, QInputDevice::MouseEmulation, QEvent::MouseMove, Qt::NoButton, QGuiApplicationPrivate::platformTheme(), QPointerEvent::pointingDevice(), pos, QEventPoint::Pressed, Q_ASSERT, qCDebug, qInf(), qmlobject_cast< QQuickItem * >(), QEventPoint::Released, QSinglePointEvent::scenePosition(), QCoreApplication::sendEvent(), QPointerEvent::setExclusiveGrabber(), QCoreApplication::testAttribute(), QPlatformTheme::themeHint(), QInputEvent::timestamp(), QVariant::toInt(), QPlatformTheme::TouchDoubleTapDistance, touchMouseDevice, touchMouseId, touchMousePressPos, touchMousePressTimestamp, QInputDevice::TouchPad, touchToMouseEvent(), QEventPoint::Updated, QGraphicsItem::window(), QPoint::x(), and QPoint::y().
Referenced by deliverMatchingPointsToItem().
bool QQuickDeliveryAgentPrivate::deliverTouchCancelEvent | ( | QTouchEvent * | event | ) |
Definition at line 1276 of file qquickdeliveryagent.cpp.
References cancelTouchMouseSynthesis(), QPointingDevicePrivate::get(), and qCDebug.
void QQuickDeliveryAgentPrivate::deliverUpdatedPoints | ( | QPointerEvent * | event | ) |
Deliver updated points to existing grabbers.
Definition at line 2035 of file qquickdeliveryagent.cpp.
References allPointsGrabbed(), QList< T >::at(), deliverMatchingPointsToItem(), deliverToPassiveGrabbers(), done, exclusiveGrabbers(), QPointingDevicePrivate::get(), QQuickItemPrivate::get(), QQuickItemPrivate::handlePointerEvent(), QQuickPointerHandler::handlePointerEvent(), hasFiltered, i, QList< T >::isEmpty(), item, localizePointerEvent(), mergePointerTargets(), pointerTargets(), QEventPoint::Pressed, Q_UNLIKELY, qmlobject_cast< QQuickItem * >(), QPointingDevicePrivate::queryPointById(), qWarning, rootItem, sendFilteredPointerEvent(), and QList< T >::size().
Referenced by deliverPointerEvent().
|
static |
Definition at line 1474 of file qquickdeliveryagent.cpp.
References QObject::connect(), QObject::destroyed(), device, QInputDevicePrivate::get(), and QInputDevicePrivate::qqExtra.
Referenced by QQuickPointerHandlerPrivate::deviceDeliveryTargets().
|
static |
Returns true
if the movement delta d in pixels along the axis exceeds startDragThreshold if it is set, or QStyleHints::startDragDistance(); or, if QEventPoint::velocity() of tp exceeds QStyleHints::startDragVelocity().
Definition at line 2723 of file qquickdeliveryagent.cpp.
References d, qAbs(), qApp, QStyleHints::startDragDistance, QStyleHints::startDragVelocity, QEventPoint::velocity, QVector2D::x(), Qt::XAxis, and QVector2D::y().
|
static |
Returns true
if the movement delta d in pixels along the axis exceeds startDragThreshold if it is set, or QStyleHints::startDragDistance(); or, if QEventPoint::velocity() of event exceeds QStyleHints::startDragVelocity().
Definition at line 2702 of file qquickdeliveryagent.cpp.
References d, qAbs(), QStyleHints::startDragDistance, QStyleHints::startDragVelocity, QGuiApplication::styleHints(), QInputDevice::Velocity, QVector2D::x(), Qt::XAxis, and QVector2D::y().
Referenced by QQuickWindowPrivate::dragOverThreshold(), QQuickWindowPrivate::dragOverThreshold(), QQuickPathViewPrivate::handleMouseMoveEvent(), QQuickFlickablePrivate::handleMoveEvent(), and QQuickMouseArea::mouseMoveEvent().
|
static |
Returns true
if the movement delta in pixels exceeds QStyleHints::startDragDistance().
Definition at line 2740 of file qquickdeliveryagent.cpp.
References qAbs(), qApp, QVector2D::x(), and QVector2D::y().
void QQuickDeliveryAgentPrivate::ensureDeviceConnected | ( | const QPointingDevice * | dev | ) |
Called when a QPointingDevice is detected, to ensure that the QPointingDevice::grabChanged() signal is connected to QQuickDeliveryAgentPrivate::onGrabChanged().
knownPointingDevices
is maintained only to track signal connections, and should not be used for other purposes. The usual place to get a list of all devices is QInputDevice::devices().
Definition at line 1849 of file qquickdeliveryagent.cpp.
References QList< T >::append(), QObject::connect(), QObjectPrivate::connect(), QListSpecialMethodsBase< T >::contains(), QObject::destroyed(), QPointingDevice::grabChanged(), knownPointingDevices, onGrabChanged(), and QList< T >::removeAll().
Referenced by deliverPointerEvent().
QPointerEvent * QQuickDeliveryAgentPrivate::eventInDelivery | ( | ) | const |
Accessor for use by legacy methods such as QQuickItem::grabMouse(), QQuickItem::ungrabMouse(), and QQuickItem::grabTouchPoints() which are not given sufficient context to do the grabbing. We should remove eventsInDelivery in Qt 7.
Definition at line 107 of file qquickdeliveryagent.cpp.
References eventsInDelivery, QList< T >::isEmpty(), and QStack< T >::top().
Referenced by removeGrabber().
QList< QObject * > QQuickDeliveryAgentPrivate::exclusiveGrabbers | ( | QPointerEvent * | ev | ) |
Definition at line 1375 of file qquickdeliveryagent.cpp.
References QPointerEvent::exclusiveGrabber(), and QPointerEvent::points().
Referenced by deliverMatchingPointsToItem(), and deliverUpdatedPoints().
void QQuickDeliveryAgentPrivate::flushFrameSynchronousEvents | ( | QQuickWindow * | win | ) |
Flush events before a frame is rendered in win.
This is here because of compressTouchEvent(): we need to ensure that coalesced touch events are actually delivered in time to cause the desired reactions of items and their handlers. And then since it was introduced because of that, we started using this function for once-per-frame hover events too, to take care of changing hover state when an item animates under the mouse cursor at a time that the mouse cursor is not moving.
This is done before QQuickItem::updatePolish() is called on all the items that requested polishing.
Definition at line 1696 of file qquickdeliveryagent.cpp.
References currentEventDeliveryAgent, delayedTouch, deliverDelayedTouchEvent(), deliverHoverEvent(), QQuickWindowPrivate::dirtyItemList, frameSynchronousHoverEnabled, QQuickWindowPrivate::get(), QQmlAnimationTimer::hasStartAnimationPending(), QQmlAnimationTimer::instance(), QPointF::isNull(), QGuiApplication::keyboardModifiers(), lastMousePosition, Q_UNLIKELY, Q_UNUSED, qCDebug, qCWarning, QQmlAnimationTimer::startAnimations(), and win.
Referenced by QQuickRenderControl::polishItems(), QSGOpenVGRenderLoop::renderWindow(), QSGGuiThreadRenderLoop::renderWindow(), and QSGSoftwareRenderLoop::renderWindow().
void QQuickDeliveryAgentPrivate::handleMouseEvent | ( | QMouseEvent * | event | ) |
Handle event on behalf of this delivery agent's window or subscene.
Definition at line 1627 of file qquickdeliveryagent.cpp.
References allowSyntheticRightClick(), deliverHoverEvent(), deliverPointerEvent(), QQuickWindowPrivate::get(), QPointF::isNull(), lastMousePosition, QEvent::MouseButtonDblClick, QEvent::MouseButtonPress, QEvent::MouseButtonRelease, Qt::MouseEventSynthesizedBySystem, QEvent::MouseMove, Q_ASSERT, Q_QUICK_INPUT_PROFILE, qCDebug, Qt::RightButton, rootItem, and QQuickItem::window().
void QQuickDeliveryAgentPrivate::handleTouchEvent | ( | QTouchEvent * | event | ) |
Definition at line 1592 of file qquickdeliveryagent.cpp.
References compressTouchEvent(), delayedTouch, deliverDelayedTouchEvent(), deliverPointerEvent(), lastMousePosition, pointerEventRecursionGuard, qCDebug, qEnvironmentVariableIsSet(), QEventPoint::Released, and translateTouchEvent().
void QQuickDeliveryAgentPrivate::handleWindowDeactivate | ( | QQuickWindow * | win | ) |
The handler for the QEvent::WindowDeactivate event, and also when Qt::ApplicationState tells us the application is no longer active. It clears all exclusive grabs of items and handlers whose window is this one, for all known pointing devices.
The QEvent is not passed into this function because in the first case it's just a plain QEvent with no extra data, and because the application state change is delivered via a signal rather than an event.
Definition at line 1312 of file qquickdeliveryagent.cpp.
References device, QInputDevice::devices(), QPointingDevicePrivate::get(), item, qCDebug, qmlobject_cast< QQuickItem * >(), win, and QGraphicsItem::window().
void QQuickDeliveryAgentPrivate::handleWindowHidden | ( | QQuickWindow * | win | ) |
Definition at line 1343 of file qquickdeliveryagent.cpp.
References clearHover(), lastMousePosition, qCDebug, and win.
|
inline |
Definition at line 107 of file qquickdeliveryagent_p_p.h.
Referenced by deliverPressOrReleaseEvent(), mousePointData(), and onGrabChanged().
|
static |
Definition at line 1462 of file qquickdeliveryagent.cpp.
References QInputEvent::device(), QInputDevice::Mouse, QInputDevice::TouchPad, and QInputDevice::type.
Referenced by isSynthMouse(), QQuickTextInput::mouseDoubleClickEvent(), QQuickTextControlPrivate::mouseDoubleClickEvent(), QQuickTextInput::mouseMoveEvent(), QQuickTextField::mouseMoveEvent(), QQuickTextControlPrivate::mouseMoveEvent(), QQuickTextEdit::mousePressEvent(), QQuickTextInput::mousePressEvent(), QQuickTextControlPrivate::mousePressEvent(), QQuickTextInput::mouseReleaseEvent(), and QQuickTextControlPrivate::mouseReleaseEvent().
|
static |
Definition at line 1423 of file qquickdeliveryagent.cpp.
References QEvent::HoverEnter, QEvent::HoverLeave, QEvent::HoverMove, and QEvent::type().
|
static |
Definition at line 1405 of file qquickdeliveryagent.cpp.
References QEvent::MouseButtonDblClick, QEvent::MouseButtonPress, QEvent::MouseButtonRelease, QEvent::MouseMove, and QEvent::type().
Referenced by QQuickPointerHandler::approveGrabTransition(), QQuickPathView::childMouseEventFilter(), deliverMatchingPointsToItem(), deliverToPassiveGrabbers(), QQuickMultiPointHandler::eligiblePoints(), QQuickFlickable::filterPointerEvent(), QQuickDragHandler::handlePointerEventImpl(), isMouseOrWheelEvent(), isSynthMouse(), sendFilteredPointerEventImpl(), QQuickTapHandler::wantsEventPoint(), and QQuickHoverHandler::wantsPointerEvent().
|
static |
Definition at line 1418 of file qquickdeliveryagent.cpp.
References isMouseEvent(), QEvent::type(), and QEvent::Wheel.
Referenced by QQuickItemPrivate::handlePointerEvent().
|
static |
Definition at line 1469 of file qquickdeliveryagent.cpp.
References isEventFromMouseOrTouchpad(), and isMouseEvent().
Referenced by QQuickWindow::event().
|
static |
Definition at line 1448 of file qquickdeliveryagent.cpp.
References QEvent::TabletEnterProximity, QEvent::TabletLeaveProximity, QEvent::TabletMove, QEvent::TabletPress, QEvent::TabletRelease, and QEvent::type().
Referenced by QQuickWindowPrivate::clearGrabbers(), deliverPointerEvent(), QQuickFlickable::filterPointerEvent(), QQuickHoverHandler::handleEventPoint(), QQuickHandlerPoint::reset(), and QQuickTapHandler::wantsEventPoint().
|
static |
Definition at line 1435 of file qquickdeliveryagent.cpp.
References QEvent::TouchBegin, QEvent::TouchCancel, QEvent::TouchEnd, QEvent::TouchUpdate, and QEvent::type().
Referenced by QQuickPointerHandler::approveGrabTransition(), deliverMatchingPointsToItem(), deliverPointerEvent(), deliverPressOrReleaseEvent(), deliverToPassiveGrabbers(), QQuickWindow::event(), QQuickFlickable::filterPointerEvent(), QQuickPointHandler::handleEventPoint(), QQuickTapHandler::handleEventPoint(), QQuickDragHandler::onActiveChanged(), QQuickHandlerPoint::reset(), sendFilteredPointerEventImpl(), and QQuickTapHandler::wantsEventPoint().
|
static |
Localize ev for delivery to dest.
Unlike QMutableTouchEvent::localized(), this modifies the QEventPoint instances in ev, which is more efficient than making a copy.
Definition at line 1365 of file qquickdeliveryagent.cpp.
References i, QQuickItem::mapFromScene(), QQuickItem::mapToScene(), QPointerEvent::point(), QPointerEvent::pointCount(), qCDebug, and QEvent::type().
Referenced by QQuickFlickable::childMouseEventFilter(), deliverMatchingPointsToItem(), deliverSinglePointEventUntilAccepted(), deliverToPassiveGrabbers(), deliverUpdatedPoints(), and sendFilteredPointerEventImpl().
QVector< QQuickItem * > QQuickDeliveryAgentPrivate::mergePointerTargets | ( | const QVector< QQuickItem * > & | list1, |
const QVector< QQuickItem * > & | list2 | ||
) | const |
Returns a joined list consisting of the items in list1 and list2. list1 has priority; common items come last.
Definition at line 2012 of file qquickdeliveryagent.cpp.
References QList< T >::at(), i, QList< T >::insert(), QListSpecialMethodsBase< T >::lastIndexOf(), list2, Q_ASSERT, and QList< T >::size().
Referenced by deliverPressOrReleaseEvent(), and deliverUpdatedPoints().
QPointingDevicePrivate::EventPointData * QQuickDeliveryAgentPrivate::mousePointData | ( | ) |
A helper function for the benefit of obsolete APIs like QQuickItem::grabMouse() that don't have the currently-being-delivered event in context. Returns the device the currently-being-delivered event comse from.
Definition at line 119 of file qquickdeliveryagent.cpp.
References eventsInDelivery, QPointingDevicePrivate::get(), isDeliveringTouchAsMouse(), QList< T >::isEmpty(), QPointerEvent::pointingDevice(), QStack< T >::top(), and touchMouseId.
Referenced by removeGrabber().
|
static |
Definition at line 574 of file qquickdeliveryagent.cpp.
References QQuickItemPrivate::activeFocus, emit, QQuickItemPrivate::Focus, QQuickItemPrivate::focus, QQuickItemPrivate::get(), item, QQuickItem::ItemActiveFocusHasChanged, QQuickItemPrivate::itemChange(), QQuickItemChangeListener::itemFocusChanged(), items, QQuickItemPrivate::notifiedActiveFocus, QQuickItemPrivate::notifiedFocus, QQuickItemPrivate::notifyChangeListeners(), and notifyFocusChangesRecur().
Referenced by clearFocusInScope(), notifyFocusChangesRecur(), QQuickItem::setFocus(), and setFocusInScope().
void QQuickDeliveryAgentPrivate::onGrabChanged | ( | QObject * | grabber, |
QPointingDevice::GrabTransition | transition, | ||
const QPointerEvent * | event, | ||
const QEventPoint & | point | ||
) |
React to the fact that grabber underwent a grab transition while an item or handler was handling point from event. I.e. handle the QPointingDevice::grabChanged() signal.
This notifies the relevant items and/or pointer handlers, and does cleanup when grabs are lost or relinquished.
Definition at line 1744 of file qquickdeliveryagent.cpp.
References QPointingDevice::CancelGrabExclusive, QPointingDevice::CancelGrabPassive, currentEventDeliveryAgent, QEventPoint::device, e, QPointingDevicePrivate::get(), QQuickItemPrivate::get(), QPointingDevice::GrabExclusive, QPointingDevice::GrabPassive, hasFiltered, QEventPoint::id, isDeliveringTouchAsMouse(), isSubsceneAgent, lastUngrabbed, QInputDevice::Mouse, QQuickItem::mouseUngrabEvent(), QPointingDevice::OverrideGrabPassive, Q_ASSERT, qCDebug, qmlobject_cast< QQuickItem * >(), QPointingDevicePrivate::queryPointById(), QEventPoint::Released, sendFilteredMouseEvent(), QPointingDevicePrivate::setPassiveGrabberContext(), QInputDevice::TouchPad, QInputDevice::TouchScreen, QInputDevice::type, QPointingDevice::UngrabExclusive, QEvent::UngrabMouse, and QPointingDevice::UngrabPassive.
Referenced by ensureDeviceConnected().
QVector< QQuickItem * > QQuickDeliveryAgentPrivate::pointerTargets | ( | QQuickItem * | item, |
const QPointerEvent * | event, | ||
const QEventPoint & | point, | ||
bool | checkMouseButtons, | ||
bool | checkAcceptsTouch | ||
) | const |
Returns a list of all items that are spatially relevant to receive event occurring at point, starting with item and recursively checking all the children.
true
, it means we are finding targets for a mouse event, so no item for which acceptedMouseButtons() is NoButton will be added. true
, it means we are finding targets for a touch event, so either acceptTouchEvents() must return true or it must accept a synthesized mouse event. I.e. if acceptTouchEvents() returns false, it gets added only if acceptedMouseButtons() is true. true
and the point is outside of QQuickItem::clipRect(), its children are also omitted (we stop the recursion, because any clipped-off portions of children under point are invisible) The list returned from this function is the list of items that will be "visited" when delivering any event for which QPointerEvent::isBeginEvent() is true
.
Definition at line 1959 of file qquickdeliveryagent.cpp.
References QGraphicsItem::acceptedMouseButtons(), QGraphicsItem::acceptTouchEvents(), QList< T >::at(), QList< T >::begin(), child, QObjectData::children, QGraphicsItem::contains(), QList< T >::end(), QQuickItemPrivate::get(), QEventPoint::id, QList< T >::insert(), it, item, QQuickItem::ItemClipsChildrenToShape, QGraphicsItem::mapFromScene(), Qt::NoButton, pointerTargets(), qCDebug, QEventPoint::scenePosition, and QList< T >::size().
Referenced by deliverPressOrReleaseEvent(), deliverSinglePointEventUntilAccepted(), deliverUpdatedPoints(), and pointerTargets().
void QQuickDeliveryAgentPrivate::removeGrabber | ( | QQuickItem * | grabber, |
bool | mouse = true , |
||
bool | touch = true , |
||
bool | cancel = false |
||
) |
Ungrabs all touchpoint grabs and/or the mouse grab from the given item grabber.
This should not be called when processing a release event - that's redundant. It is called in other cases, when the points may not be released, but the item nevertheless must lose its grab due to becoming disabled, invisible, etc. QPointerEvent::setExclusiveGrabber() calls touchUngrabEvent() when all points are released, but if not all points are released, it cannot be sure whether to call touchUngrabEvent() or not; so we have to do it here.
Definition at line 261 of file qquickdeliveryagent.cpp.
References cancel(), device, QInputDevice::devices(), eventInDelivery(), eventsInDelivery, QPointingDevicePrivate::get(), QList< T >::isEmpty(), knownPointingDevices, mousePointData(), Q_LIKELY, qCDebug, qobject_cast< QQuickItem * >(), QPointerEvent::setExclusiveGrabber(), QStack< T >::top(), QInputDevice::TouchScreen, and QQuickItem::touchUngrabEvent().
Referenced by QQuickItemPrivate::setEffectiveEnableRecur().
bool QQuickDeliveryAgentPrivate::sendFilteredMouseEvent | ( | QEvent * | event, |
QQuickItem * | receiver, | ||
QQuickItem * | filteringParent | ||
) |
Allow filteringParent to filter event on behalf of receiver, via QQuickItem::childMouseEventFilter(). This happens right before we would send event to receiver.
Returns true
only if event has been intercepted (by filteringParent or some other filtering ancestor) and should not be sent to receiver.
Unlike sendFilteredPointerEvent(), this version does not synthesize a mouse event from touch (presumably it's already an actual mouse event).
Definition at line 2673 of file qquickdeliveryagent.cpp.
References QQuickItem::childMouseEventFilter(), QQuickItemPrivate::filtersChildMouseEvents, QQuickItemPrivate::get(), hasFiltered, QQuickItem::parentItem(), qCDebug, QQuickItemPrivate::replayingPressEvent, sendFilteredMouseEvent(), and skipDelivery.
Referenced by onGrabChanged(), sendFilteredMouseEvent(), and sendHoverEvent().
bool QQuickDeliveryAgentPrivate::sendFilteredPointerEvent | ( | QPointerEvent * | event, |
QQuickItem * | receiver, | ||
QQuickItem * | filteringParent = nullptr |
||
) |
Allow filteringParent to filter event on behalf of receiver, via QQuickItem::childMouseEventFilter(). This happens right before we would send event to receiver.
Returns true
only if event has been intercepted (by filteringParent or some other filtering ancestor) and should not be sent to receiver.
Definition at line 2532 of file qquickdeliveryagent.cpp.
References QQuickItem::parentItem(), and sendFilteredPointerEventImpl().
Referenced by deliverMatchingPointsToItem(), deliverPressOrReleaseEvent(), deliverToPassiveGrabbers(), and deliverUpdatedPoints().
bool QQuickDeliveryAgentPrivate::sendFilteredPointerEventImpl | ( | QPointerEvent * | event, |
QQuickItem * | receiver, | ||
QQuickItem * | filteringParent | ||
) |
The recursive implementation of sendFilteredPointerEvent().
Definition at line 2540 of file qquickdeliveryagent.cpp.
References Qt::AA_SynthesizeMouseForUnhandledTouchEvents, QQuickItem::acceptedMouseButtons(), QQuickItem::acceptTouchEvents(), allowChildEventFiltering, cancelTouchMouseSynthesis(), QQuickItem::childMouseEventFilter(), device, QQuickItem::filtersChildMouseEvents(), QQuickItemPrivate::get(), QQuickItem::grabMouse(), hasFiltered, QQuickItemPrivate::hasPointerHandlers(), Qt::hex(), QEvent::isAccepted(), isMouseEvent(), isTouchEvent(), QQuickItem::keepTouchGrab(), QQuickItemPrivate::localizedTouchEvent(), localizePointerEvent(), QEvent::MouseButtonPress, QEvent::MouseButtonRelease, QInputDevice::MouseEmulation, QEvent::MouseMove, QQuickItem::mouseUngrabEvent(), QEvent::None, QQuickItem::parentItem(), QPointerEvent::point(), QEventPoint::Pressed, Q_ASSERT, Q_LIKELY, qCDebug, qobject_cast< const QQuickItem * >(), QEventPoint::Released, sendFilteredPointerEventImpl(), QEventPoint::setAccepted(), skipDelivery, QEventPoint::Stationary, QCoreApplication::testAttribute(), touchMouseDevice, touchMouseId, QInputDevice::TouchPad, touchToMouseEvent(), and QEvent::type().
Referenced by sendFilteredPointerEvent(), and sendFilteredPointerEventImpl().
bool QQuickDeliveryAgentPrivate::sendHoverEvent | ( | QEvent::Type | type, |
QQuickItem * | item, | ||
const QPointF & | scenePos, | ||
const QPointF & | lastScenePos, | ||
Qt::KeyboardModifiers | modifiers, | ||
ulong | timestamp | ||
) |
Definition at line 975 of file qquickdeliveryagent.cpp.
References QQuickItemPrivate::get(), hasFiltered, QEvent::isAccepted(), item, QGraphicsItem::parentItem(), QPointerEvent::point(), QCoreApplication::sendEvent(), sendFilteredMouseEvent(), QPointerEvent::setAccepted(), and QPointerEvent::setTimestamp().
Referenced by deliverHoverEventToItem().
void QQuickDeliveryAgentPrivate::setFocusInScope | ( | QQuickItem * | scope, |
QQuickItem * | item, | ||
Qt::FocusReason | reason, | ||
FocusOptions | options = { } |
||
) |
Set the focus inside scope to be item.
If the scope contains the active focus item, it will be changed to item. Calls notifyFocusChangesRecur for all changed items.
Definition at line 338 of file qquickdeliveryagent.cpp.
References QQuickItemPrivate::activeFocus, activeFocusItem, QInputMethod::commit(), QVarLengthArray< T, Prealloc >::data(), QQuickWindowPrivate::deliveryAgent, QQuickWindowPrivate::deliveryAgentPrivate(), DontChangeFocusProperty, DontChangeSubFocusItem, emit, QQuickItemPrivate::Focus, QQuickItemPrivate::focus, QEvent::FocusIn, QWindow::focusObjectChanged(), QEvent::FocusOut, QQuickItemPrivate::get(), QQuickWindowPrivate::get(), QQuickItem::hasFocus(), QGuiApplication::inputMethod(), QVarLengthArray< T, Prealloc >::isEmpty(), QGraphicsItem::isEnabled(), QQuickItem::isEnabled(), QQuickItem::isFocusScope(), isSubsceneAgent, item, QQuickItemChangeListener::itemFocusChanged(), lastFocusReason, QQuickItemPrivate::notifyChangeListeners(), notifyFocusChangesRecur(), QQuickItem::parentItem(), priv(), Q_ASSERT, qCDebug, rootItem, QQuickItem::scopedFocusItem(), QCoreApplication::sendEvent(), setFocusInScope(), QVLABaseBase::size(), QQuickItemPrivate::subFocusItem, updateFocusItemTransform(), QQuickItemPrivate::updateSubFocusItem(), QQuickItem::window(), and windowHasFocus().
Referenced by QQuickItemPrivate::setEffectiveEnableRecur(), and setFocusInScope().
void QQuickDeliveryAgentPrivate::touchToMouseEvent | ( | QEvent::Type | type, |
const QEventPoint & | p, | ||
const QTouchEvent * | touchEvent, | ||
QMutableSinglePointEvent * | mouseEvent | ||
) |
Definition at line 56 of file qquickdeliveryagent.cpp.
References Qt::AA_SynthesizeMouseForUnhandledTouchEvents, QInputEvent::device(), QTest::QTouchEventSequence::device, Qt::LeftButton, QInputDevice::Mouse, QEvent::MouseButtonRelease, Qt::MouseEventSynthesizedByQt, QEvent::MouseMove, Qt::NoButton, Q_ASSERT, Q_UNLIKELY, qWarning, ret, QCoreApplication::testAttribute(), and QInputDevice::type.
Referenced by deliverTouchAsMouse(), and sendFilteredPointerEventImpl().
void QQuickDeliveryAgentPrivate::translateTouchEvent | ( | QTouchEvent * | touchEvent | ) |
Translates QEventPoint::scenePosition() in touchEvent to this window.
The item-local QEventPoint::position() is updated later, not here.
Definition at line 301 of file qquickdeliveryagent.cpp.
References i, and QTest::QTouchEventSequence::point().
Referenced by handleTouchEvent().
void QQuickDeliveryAgentPrivate::updateFocusItemTransform | ( | ) |
Definition at line 623 of file qquickdeliveryagent.cpp.
References activeFocusItem, QGuiApplication::focusObject(), QQuickItemPrivate::get(), Qt::ImInputItemClipRectangle, QGuiApplication::inputMethod(), QQuickItemPrivate::itemToWindowTransform(), QInputMethod::setInputItemRectangle(), and QInputMethod::setInputItemTransform().
Referenced by clearFocusInScope(), QQuickWindowPrivate::polishItems(), and setFocusInScope().
QQuickItem* QQuickDeliveryAgentPrivate::activeFocusItem = nullptr |
Definition at line 52 of file qquickdeliveryagent_p_p.h.
Referenced by clearFocusInScope(), clearFocusObject(), setFocusInScope(), and updateFocusItemTransform().
bool QQuickDeliveryAgentPrivate::allowChildEventFiltering = true |
Definition at line 86 of file qquickdeliveryagent_p_p.h.
Referenced by sendFilteredPointerEventImpl().
uchar QQuickDeliveryAgentPrivate::compressedTouchCount = 0 |
Definition at line 85 of file qquickdeliveryagent_p_p.h.
Referenced by compressTouchEvent(), and deliverDelayedTouchEvent().
|
static |
Definition at line 93 of file qquickdeliveryagent_p_p.h.
Referenced by QQuickPointerHandler::approveGrabTransition(), currentOrItemDeliveryAgent(), QQuickOverlay::eventFilter(), flushFrameSynchronousEvents(), and onGrabChanged().
uint QQuickDeliveryAgentPrivate::currentHoverId = 0 |
Definition at line 81 of file qquickdeliveryagent_p_p.h.
Referenced by deliverHoverEvent(), and deliverHoverEventToItem().
std::unique_ptr<QMutableTouchEvent> QQuickDeliveryAgentPrivate::delayedTouch |
Definition at line 78 of file qquickdeliveryagent_p_p.h.
Referenced by compressTouchEvent(), deliverDelayedTouchEvent(), QQuickTouchUtils::flush(), flushFrameSynchronousEvents(), and handleTouchEvent().
QStack<QPointerEvent *> QQuickDeliveryAgentPrivate::eventsInDelivery |
Definition at line 73 of file qquickdeliveryagent_p_p.h.
Referenced by deliverPointerEvent(), eventInDelivery(), mousePointData(), and removeGrabber().
bool QQuickDeliveryAgentPrivate::frameSynchronousHoverEnabled = true |
Definition at line 87 of file qquickdeliveryagent_p_p.h.
Referenced by flushFrameSynchronousEvents().
QVector<QQuickItem *> QQuickDeliveryAgentPrivate::hasFiltered |
Definition at line 75 of file qquickdeliveryagent_p_p.h.
Referenced by deliverPressOrReleaseEvent(), deliverToPassiveGrabbers(), deliverUpdatedPoints(), onGrabChanged(), sendFilteredMouseEvent(), sendFilteredPointerEventImpl(), and sendHoverEvent().
bool QQuickDeliveryAgentPrivate::hoveredLeafItemFound = false |
Definition at line 88 of file qquickdeliveryagent_p_p.h.
Referenced by deliverHoverEvent(), deliverHoverEventRecursive(), deliverHoverEventToItem(), and QQuickMouseArea::itemChange().
QFlatMap<QPointer<QQuickItem>, uint> QQuickDeliveryAgentPrivate::hoverItems |
Definition at line 74 of file qquickdeliveryagent_p_p.h.
Referenced by clearHover(), deliverHoverEvent(), deliverHoverEventToItem(), and QQuickMouseArea::itemChange().
bool QQuickDeliveryAgentPrivate::isSubsceneAgent = false |
Definition at line 90 of file qquickdeliveryagent_p_p.h.
Referenced by QQuickDeliveryAgentPrivate(), clearFocusInScope(), compressTouchEvent(), deliverPointerEvent(), deliverPressOrReleaseEvent(), onGrabChanged(), and setFocusInScope().
QList<const QPointingDevice *> QQuickDeliveryAgentPrivate::knownPointingDevices |
Definition at line 79 of file qquickdeliveryagent_p_p.h.
Referenced by ensureDeviceConnected(), and removeGrabber().
Qt::FocusReason QQuickDeliveryAgentPrivate::lastFocusReason = Qt::OtherFocusReason |
Definition at line 96 of file qquickdeliveryagent_p_p.h.
Referenced by clearFocusInScope(), and setFocusInScope().
QPointF QQuickDeliveryAgentPrivate::lastMousePosition |
Definition at line 115 of file qquickdeliveryagent_p_p.h.
Referenced by deliverTouchAsMouse(), flushFrameSynchronousEvents(), handleMouseEvent(), handleTouchEvent(), and handleWindowHidden().
QQuickItem* QQuickDeliveryAgentPrivate::lastUngrabbed = nullptr |
Definition at line 72 of file qquickdeliveryagent_p_p.h.
Referenced by deliverMatchingPointsToItem(), deliverPointerEvent(), and onGrabChanged().
int QQuickDeliveryAgentPrivate::pointerEventRecursionGuard = 0 |
Definition at line 97 of file qquickdeliveryagent_p_p.h.
Referenced by deliverPointerEvent(), and handleTouchEvent().
QQuickItem* QQuickDeliveryAgentPrivate::rootItem = nullptr |
Definition at line 50 of file qquickdeliveryagent_p_p.h.
Referenced by clearFocusInScope(), clearFocusObject(), clearHover(), compressTouchEvent(), deliverHoverEvent(), deliverPressOrReleaseEvent(), deliverSinglePointEventUntilAccepted(), deliverUpdatedPoints(), handleMouseEvent(), and setFocusInScope().
QQuickDeliveryAgent::Transform* QQuickDeliveryAgentPrivate::sceneTransform = nullptr |
Definition at line 105 of file qquickdeliveryagent_p_p.h.
Referenced by ~QQuickDeliveryAgentPrivate(), and deliverPointerEvent().
QVector<QQuickItem *> QQuickDeliveryAgentPrivate::skipDelivery |
Definition at line 76 of file qquickdeliveryagent_p_p.h.
Referenced by deliverPointerEvent(), deliverPressOrReleaseEvent(), sendFilteredMouseEvent(), and sendFilteredPointerEventImpl().
|
static |
Definition at line 91 of file qquickdeliveryagent_p_p.h.
Referenced by QQuickDeliveryAgentPrivate(), and QQuickWindow::event().
const QPointingDevice* QQuickDeliveryAgentPrivate::touchMouseDevice = nullptr |
Definition at line 101 of file qquickdeliveryagent_p_p.h.
Referenced by cancelTouchMouseSynthesis(), deliverPressOrReleaseEvent(), deliverTouchAsMouse(), and sendFilteredPointerEventImpl().
int QQuickDeliveryAgentPrivate::touchMouseId = -1 |
Definition at line 99 of file qquickdeliveryagent_p_p.h.
Referenced by cancelTouchMouseSynthesis(), deliverPointerEvent(), deliverPressOrReleaseEvent(), deliverTouchAsMouse(), mousePointData(), and sendFilteredPointerEventImpl().
QPoint QQuickDeliveryAgentPrivate::touchMousePressPos |
Definition at line 103 of file qquickdeliveryagent_p_p.h.
Referenced by checkIfDoubleTapped(), and deliverTouchAsMouse().
ulong QQuickDeliveryAgentPrivate::touchMousePressTimestamp = 0 |
Definition at line 102 of file qquickdeliveryagent_p_p.h.
Referenced by checkIfDoubleTapped(), and deliverTouchAsMouse().