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
QQuickDeliveryAgentPrivate Class Reference

#include <qquickdeliveryagent_p_p.h>

+ Inheritance diagram for QQuickDeliveryAgentPrivate:
+ Collaboration diagram for QQuickDeliveryAgentPrivate:

Public Types

enum  FocusOption { DontChangeFocusProperty = 0x01 , DontChangeSubFocusItem = 0x02 }
 
enum class  HoverChange : uint8_t { Clear , Set }
 
- Public Types inherited from QObjectPrivate
typedef void(* StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **)
 
using ConnectionDataPointer = QExplicitlySharedDataPointer<ConnectionData>
 

Public Member Functions

 QQuickDeliveryAgentPrivate (QQuickItem *root)
 
 ~QQuickDeliveryAgentPrivate ()
 
void deliverKeyEvent (QKeyEvent *e)
 
void setFocusInScope (QQuickItem *scope, QQuickItem *item, Qt::FocusReason reason, FocusOptions={ })
 Set the focus inside scope to be item.
 
void clearFocusInScope (QQuickItem *scope, QQuickItem *item, Qt::FocusReason reason, FocusOptions={ })
 
void clearFocusObject ()
 
void updateFocusItemTransform ()
 
QQuickItemfocusTargetItem () const
 Returns the item that should get active focus when the root focus scope gets active focus.
 
bool isDeliveringTouchAsMouse () const
 
void cancelTouchMouseSynthesis ()
 
bool checkIfDoubleTapped (ulong newPressEventTimestamp, QPoint newPressPos)
 
QPointingDevicePrivate::EventPointDatamousePointData ()
 
QPointerEventeventInDelivery () const
 
bool deliverTouchAsMouse (QQuickItem *item, QTouchEvent *pointerEvent)
 
void translateTouchEvent (QTouchEvent *touchEvent)
 
void 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.
 
void onGrabChanged (QObject *grabber, QPointingDevice::GrabTransition transition, const QPointerEvent *event, const QEventPoint &point)
 
void deliverToPassiveGrabbers (const QVector< QPointer< QObject > > &passiveGrabbers, QPointerEvent *pointerEvent)
 
bool sendFilteredMouseEvent (QEvent *event, QQuickItem *receiver, QQuickItem *filteringParent)
 
bool sendFilteredPointerEvent (QPointerEvent *event, QQuickItem *receiver, QQuickItem *filteringParent=nullptr)
 
bool sendFilteredPointerEventImpl (QPointerEvent *event, QQuickItem *receiver, QQuickItem *filteringParent)
 
bool deliverSinglePointEventUntilAccepted (QPointerEvent *)
 
void handleTouchEvent (QTouchEvent *)
 
void handleMouseEvent (QMouseEvent *)
 Handle event on behalf of this delivery agent's window or subscene.
 
bool compressTouchEvent (QTouchEvent *)
 
void flushFrameSynchronousEvents (QQuickWindow *win)
 
void deliverDelayedTouchEvent ()
 
void handleWindowDeactivate (QQuickWindow *win)
 
void handleWindowHidden (QQuickWindow *win)
 
bool allUpdatedPointsAccepted (const QPointerEvent *ev)
 
QList< QObject * > exclusiveGrabbers (QPointerEvent *ev)
 
void touchToMouseEvent (QEvent::Type type, const QEventPoint &p, const QTouchEvent *touchEvent, QMutableSinglePointEvent *mouseEvent)
 
void ensureDeviceConnected (const QPointingDevice *dev)
 
void deliverPointerEvent (QPointerEvent *)
 
bool deliverTouchCancelEvent (QTouchEvent *)
 
bool deliverPressOrReleaseEvent (QPointerEvent *, bool handlersOnly=false)
 
void deliverUpdatedPoints (QPointerEvent *event)
 
void deliverMatchingPointsToItem (QQuickItem *item, bool isGrabber, QPointerEvent *pointerEvent, bool handlersOnly=false)
 
QVector< QQuickItem * > pointerTargets (QQuickItem *, const QPointerEvent *event, const QEventPoint &point, bool checkMouseButtons, bool checkAcceptsTouch) const
 
QVector< QQuickItem * > mergePointerTargets (const QVector< QQuickItem * > &list1, const QVector< QQuickItem * > &list2) const
 
bool deliverHoverEvent (const QPointF &scenePos, const QPointF &lastScenePos, Qt::KeyboardModifiers modifiers, ulong timestamp)
 
bool deliverHoverEventRecursive (QQuickItem *, const QPointF &scenePos, const QPointF &lastScenePos, Qt::KeyboardModifiers modifiers, ulong timestamp)
 
bool deliverHoverEventToItem (QQuickItem *item, const QPointF &scenePos, const QPointF &lastScenePos, Qt::KeyboardModifiers modifiers, ulong timestamp, HoverChange hoverChange)
 
bool sendHoverEvent (QEvent::Type, QQuickItem *, const QPointF &scenePos, const QPointF &lastScenePos, Qt::KeyboardModifiers modifiers, ulong timestamp)
 
bool clearHover (ulong timestamp=0)
 
- 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 void notifyFocusChangesRecur (QQuickItem **item, int remaining, Qt::FocusReason reason)
 
static QQuickDeliveryAgentcurrentOrItemDeliveryAgent (const QQuickItem *item)
 
static QPointerEventclonePointerEvent (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 QQuickPointingDeviceExtradeviceExtra (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 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

QQuickItemrootItem = nullptr
 
QQuickItemactiveFocusItem = nullptr
 
QQuickItemlastUngrabbed = nullptr
 
QStack< QPointerEvent * > eventsInDelivery
 
QFlatMap< QPointer< QQuickItem >, uinthoverItems
 
QVector< QQuickItem * > hasFiltered
 
QVector< QQuickItem * > skipDelivery
 
std::unique_ptr< QMutableTouchEventdelayedTouch
 
QList< const QPointingDevice * > knownPointingDevices
 
uint currentHoverId = 0
 
uchar compressedTouchCount = 0
 
bool allowChildEventFiltering = true
 
bool frameSynchronousHoverEnabled = true
 
bool hoveredLeafItemFound = false
 
bool isSubsceneAgent = false
 
Qt::FocusReason lastFocusReason = Qt::OtherFocusReason
 
int pointerEventRecursionGuard = 0
 
int touchMouseId = -1
 
const QPointingDevicetouchMouseDevice = nullptr
 
ulong touchMousePressTimestamp = 0
 
QPoint touchMousePressPos
 
QQuickDeliveryAgent::TransformsceneTransform = nullptr
 
QPointF lastMousePosition
 
- 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
 

Static Public Attributes

static bool subsceneAgentsExist
 
static QQuickDeliveryAgentcurrentEventDeliveryAgent
 

Detailed Description

Definition at line 45 of file qquickdeliveryagent_p_p.h.

Member Enumeration Documentation

◆ FocusOption

Enumerator
DontChangeFocusProperty 
DontChangeSubFocusItem 

Definition at line 58 of file qquickdeliveryagent_p_p.h.

◆ HoverChange

enum class QQuickDeliveryAgentPrivate::HoverChange : uint8_t
strong
Enumerator
Clear 
Set 

Definition at line 169 of file qquickdeliveryagent_p_p.h.

Constructor & Destructor Documentation

◆ QQuickDeliveryAgentPrivate()

QQuickDeliveryAgentPrivate::QQuickDeliveryAgentPrivate ( QQuickItem * root)

Definition at line 918 of file qquickdeliveryagent.cpp.

References isSubsceneAgent, and subsceneAgentsExist.

◆ ~QQuickDeliveryAgentPrivate()

QQuickDeliveryAgentPrivate::~QQuickDeliveryAgentPrivate ( )

Definition at line 931 of file qquickdeliveryagent.cpp.

References sceneTransform.

Member Function Documentation

◆ allPointsGrabbed()

bool QQuickDeliveryAgentPrivate::allPointsGrabbed ( const QPointerEvent * ev)
static

Definition at line 1431 of file qquickdeliveryagent.cpp.

Referenced by deliverUpdatedPoints().

+ Here is the caller graph for this function:

◆ allUpdatedPointsAccepted()

bool QQuickDeliveryAgentPrivate::allUpdatedPointsAccepted ( const QPointerEvent * ev)

Definition at line 1385 of file qquickdeliveryagent.cpp.

References QEventPoint::Pressed.

Referenced by deliverPointerEvent().

+ Here is the caller graph for this function:

◆ anyPointGrabbed()

bool QQuickDeliveryAgentPrivate::anyPointGrabbed ( const QPointerEvent * ev)
static

Definition at line 1422 of file qquickdeliveryagent.cpp.

◆ cancelTouchMouseSynthesis()

void QQuickDeliveryAgentPrivate::cancelTouchMouseSynthesis ( )

Definition at line 129 of file qquickdeliveryagent.cpp.

References qCDebug, touchMouseDevice, and touchMouseId.

Referenced by deliverPointerEvent(), deliverPressOrReleaseEvent(), deliverTouchAsMouse(), deliverTouchCancelEvent(), and sendFilteredPointerEventImpl().

+ Here is the caller graph for this function:

◆ checkIfDoubleTapped()

bool QQuickDeliveryAgentPrivate::checkIfDoubleTapped ( ulong newPressEventTimestamp,
QPoint newPressPos )

Definition at line 75 of file qquickdeliveryagent.cpp.

References qAbs(), QGuiApplication::styleHints(), touchMousePressPos, and touchMousePressTimestamp.

Referenced by deliverTouchAsMouse().

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

◆ clearFocusInScope()

void QQuickDeliveryAgentPrivate::clearFocusInScope ( QQuickItem * scope,
QQuickItem * item,
Qt::FocusReason reason,
FocusOptions options = { } )

Definition at line 488 of file qquickdeliveryagent.cpp.

References activeFocusItem, DontChangeFocusProperty, DontChangeSubFocusItem, emit, QQuickItemPrivate::Focus, QEvent::FocusIn, QWindow::focusObjectChanged(), QEvent::FocusOut, QQuickItemPrivate::get(), QQuickWindowPrivate::get(), QGuiApplication::inputMethod(), isSubsceneAgent, item, QQuickItemChangeListener::itemFocusChanged(), lastFocusReason, notifyFocusChangesRecur(), priv(), Q_ASSERT, qCDebug, rootItem, QCoreApplication::sendEvent(), updateFocusItemTransform(), and QQuickItem::window().

Referenced by clearFocusObject(), and QQuickTableViewPrivate::releaseItem().

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

◆ clearFocusObject()

void QQuickDeliveryAgentPrivate::clearFocusObject ( )

Definition at line 588 of file qquickdeliveryagent.cpp.

References activeFocusItem, clearFocusInScope(), QQuickItemPrivate::get(), Qt::OtherFocusReason, and rootItem.

+ Here is the call graph for this function:

◆ clearHover()

bool QQuickDeliveryAgentPrivate::clearHover ( ulong timestamp = 0)

Definition at line 621 of file qquickdeliveryagent.cpp.

References Clear, deliverHoverEventToItem(), hoverItems, QFlatMap< Key, T, Compare, KeyContainer, MappedContainer >::isEmpty(), item, QGuiApplication::keyboardModifiers(), QGuiApplicationPrivate::lastCursorPosition, Q_ASSERT, rootItem, window(), and QQuickItem::window().

Referenced by handleWindowHidden().

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

◆ clonePointerEvent()

QPointerEvent * QQuickDeliveryAgentPrivate::clonePointerEvent ( QPointerEvent * event,
std::optional< QPointF > transformedLocalPos = std::nullopt )
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.

Note
some subclasses of QSinglePointEvent, such as QWheelEvent, add extra storage. This function doesn't yet support cloning all of those; it can be extended if needed.

Definition at line 947 of file qquickdeliveryagent.cpp.

References QEvent::clone(), QMutableEventPoint::detach(), ret, QMutableEventPoint::setTimestamp(), and QEventPoint::timestamp.

Referenced by QQuickFlickablePrivate::captureDelayedPress(), QQuickFlickable::filterPointerEvent(), and QQuickFlickable::touchEvent().

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

◆ compressTouchEvent()

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 1547 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().

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

◆ currentOrItemDeliveryAgent()

QQuickDeliveryAgent * QQuickDeliveryAgentPrivate::currentOrItemDeliveryAgent ( const QQuickItem * item)
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 682 of file qquickdeliveryagent.cpp.

References currentEventDeliveryAgent, QQuickItemPrivate::get(), and item.

Referenced by QQuickPointerHandler::setPassiveGrab().

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

◆ deliverDelayedTouchEvent()

void QQuickDeliveryAgentPrivate::deliverDelayedTouchEvent ( )

Definition at line 1326 of file qquickdeliveryagent.cpp.

References compressedTouchCount, delayedTouch, deliverPointerEvent(), and qCDebug.

Referenced by compressTouchEvent(), flushFrameSynchronousEvents(), and handleTouchEvent().

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

◆ deliverHoverEvent()

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 1038 of file qquickdeliveryagent.cpp.

References QFlatMap< Key, T, Compare, KeyContainer, MappedContainer >::begin(), Clear, currentHoverId, 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, and rootItem.

Referenced by deliverTouchAsMouse(), flushFrameSynchronousEvents(), handleMouseEvent(), and QQuickMouseArea::itemChange().

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

◆ deliverHoverEventRecursive()

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 1127 of file qquickdeliveryagent.cpp.

References QList< T >::at(), child, QObjectData::children, deliverHoverEventRecursive(), deliverHoverEventToItem(), QQuickItemPrivate::get(), hoveredLeafItemFound, item, QQuickItem::ItemClipsChildrenToShape, QQuickItemPrivate::paintOrderChildItems(), Set, and QList< T >::size().

Referenced by deliverHoverEvent(), and deliverHoverEventRecursive().

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

◆ deliverHoverEventToItem()

bool QQuickDeliveryAgentPrivate::deliverHoverEventToItem ( QQuickItem * item,
const QPointF & scenePos,
const QPointF & lastScenePos,
Qt::KeyboardModifiers modifiers,
ulong timestamp,
HoverChange hoverChange )

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 1174 of file qquickdeliveryagent.cpp.

References Clear, QGraphicsItem::contains(), currentHoverId, QFlatMap< Key, T, Compare, KeyContainer, MappedContainer >::end(), QQuickItemPrivate::extra, QFlatMap< Key, T, Compare, KeyContainer, MappedContainer >::find(), 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(), Set, QPointerEvent::setAccepted(), and QPointerEvent::setTimestamp().

Referenced by clearHover(), deliverHoverEvent(), deliverHoverEventRecursive(), and deliverUpdatedPoints().

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

◆ deliverKeyEvent()

void QQuickDeliveryAgentPrivate::deliverKeyEvent ( QKeyEvent * e)

◆ deliverMatchingPointsToItem()

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 2286 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().

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

◆ deliverPointerEvent()

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 1909 of file qquickdeliveryagent.cpp.

References allUpdatedPointsAccepted(), 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, sceneTransform, skipDelivery, and touchMouseId.

Referenced by deliverDelayedTouchEvent(), handleMouseEvent(), and handleTouchEvent().

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

◆ deliverPressOrReleaseEvent()

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 2213 of file qquickdeliveryagent.cpp.

References cancelTouchMouseSynthesis(), deliverMatchingPointsToItem(), QPointingDevicePrivate::get(), QQuickItemPrivate::get(), hasFiltered, Qt::hex(), i, isDeliveringTouchAsMouse(), isSubsceneAgent, isTouchEvent(), item, mergePointerTargets(), pointerTargets(), qCWarning, rootItem, sendFilteredPointerEvent(), skipDelivery, touchMouseDevice, and touchMouseId.

Referenced by deliverPointerEvent().

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

◆ deliverSinglePointEventUntilAccepted()

bool QQuickDeliveryAgentPrivate::deliverSinglePointEventUntilAccepted ( QPointerEvent * event)

Definition at line 1270 of file qquickdeliveryagent.cpp.

References QQuickPointerHandlerPrivate::deviceDeliveryTargets(), QQuickItemPrivate::get(), QQuickItemPrivate::handlePointerEvent(), QEventPoint::isAccepted(), item, localizePointerEvent(), pointerTargets(), Q_ASSERT, qCDebug, rootItem, QCoreApplication::sendEvent(), and QEventPoint::setAccepted().

+ Here is the call graph for this function:

◆ deliverToPassiveGrabbers()

void QQuickDeliveryAgentPrivate::deliverToPassiveGrabbers ( const QVector< QPointer< QObject > > & passiveGrabbers,
QPointerEvent * pointerEvent )

Definition at line 959 of file qquickdeliveryagent.cpp.

References QEvent::accept(), QInputEvent::device(), QQuickPointerHandlerPrivate::deviceDeliveryTargets(), QSet< T >::end(), QPointerEvent::exclusiveGrabber(), hasFiltered, isMouseEvent(), isTouchEvent(), it, localizePointerEvent(), QQuickItem::parentItem(), QPointerEvent::point(), Q_UNLIKELY, qMakePair(), QCoreApplication::sendEvent(), and sendFilteredPointerEvent().

Referenced by deliverUpdatedPoints().

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

◆ deliverTouchAsMouse()

bool QQuickDeliveryAgentPrivate::deliverTouchAsMouse ( QQuickItem * item,
QTouchEvent * pointerEvent )

Definition at line 136 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, 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(), QEventPoint::Released, QSinglePointEvent::scenePosition(), QCoreApplication::sendEvent(), QPointerEvent::setExclusiveGrabber(), QCoreApplication::testAttribute(), QInputEvent::timestamp(), QPlatformTheme::TouchDoubleTapDistance, touchMouseDevice, touchMouseId, touchMousePressPos, touchMousePressTimestamp, QInputDevice::TouchPad, touchToMouseEvent(), QEventPoint::Updated, and QGraphicsItem::window().

Referenced by deliverMatchingPointsToItem().

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

◆ deliverTouchCancelEvent()

bool QQuickDeliveryAgentPrivate::deliverTouchCancelEvent ( QTouchEvent * event)

Definition at line 1311 of file qquickdeliveryagent.cpp.

References cancelTouchMouseSynthesis(), QPointingDevicePrivate::get(), and qCDebug.

+ Here is the call graph for this function:

◆ deliverUpdatedPoints()

void QQuickDeliveryAgentPrivate::deliverUpdatedPoints ( QPointerEvent * event)

Deliver updated points to existing grabbers.

Definition at line 2084 of file qquickdeliveryagent.cpp.

References allPointsGrabbed(), deliverHoverEventToItem(), deliverMatchingPointsToItem(), deliverToPassiveGrabbers(), done, exclusiveGrabbers(), QPointingDevicePrivate::get(), QQuickItemPrivate::get(), QQuickItemPrivate::handlePointerEvent(), QQuickPointerHandler::handlePointerEvent(), hasFiltered, hoverItems, i, item, localizePointerEvent(), mergePointerTargets(), pointerTargets(), QEventPoint::Pressed, Q_ASSERT, Q_UNLIKELY, qmlobject_cast< QQuickItem * >(), qWarning, rootItem, sendFilteredPointerEvent(), Set, QEvent::TouchUpdate, and QFlatMap< Key, T, Compare, KeyContainer, MappedContainer >::value().

Referenced by deliverPointerEvent().

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

◆ deviceExtra()

QQuickPointingDeviceExtra * QQuickDeliveryAgentPrivate::deviceExtra ( const QInputDevice * device)
static

Definition at line 1509 of file qquickdeliveryagent.cpp.

References QObject::connect(), QObject::destroyed(), device, and QInputDevicePrivate::get().

Referenced by QQuickPointerHandlerPrivate::deviceDeliveryTargets().

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

◆ dragOverThreshold() [1/3]

bool QQuickDeliveryAgentPrivate::dragOverThreshold ( qreal d,
Qt::Axis axis,
const QEventPoint & tp,
int startDragThreshold = -1 )
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().

See also
QQuickPointerHandlerPrivate::dragOverThreshold()

Definition at line 2791 of file qquickdeliveryagent.cpp.

References d, qAbs(), qApp, QStyleHints::startDragDistance, QStyleHints::startDragVelocity, QEventPoint::velocity, QVector2D::x(), Qt::XAxis, and QVector2D::y().

+ Here is the call graph for this function:

◆ dragOverThreshold() [2/3]

bool QQuickDeliveryAgentPrivate::dragOverThreshold ( qreal d,
Qt::Axis axis,
QMouseEvent * event,
int startDragThreshold = -1 )
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().

See also
QQuickPointerHandlerPrivate::dragOverThreshold()

Definition at line 2770 of file qquickdeliveryagent.cpp.

References d, qAbs(), QStyleHints::startDragDistance, QStyleHints::startDragVelocity, QGuiApplication::styleHints(), QInputDevice::Velocity, QVector2D::x(), and Qt::XAxis.

Referenced by QQuickWindowPrivate::dragOverThreshold(), QQuickWindowPrivate::dragOverThreshold(), QQuickPathViewPrivate::handleMouseMoveEvent(), QQuickFlickablePrivate::handleMoveEvent(), and QQuickMouseArea::mouseMoveEvent().

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

◆ dragOverThreshold() [3/3]

bool QQuickDeliveryAgentPrivate::dragOverThreshold ( QVector2D delta)
static

Returns true if the movement delta in pixels exceeds QStyleHints::startDragDistance().

See also
QQuickDeliveryAgentPrivate::dragOverThreshold()

Definition at line 2808 of file qquickdeliveryagent.cpp.

References qAbs(), qApp, QVector2D::x(), and QVector2D::y().

+ Here is the call graph for this function:

◆ ensureDeviceConnected()

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 1892 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().

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

◆ eventInDelivery()

QPointerEvent * QQuickDeliveryAgentPrivate::eventInDelivery ( ) const
Deprecated
events are handled by methods in which the event is an argument

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 109 of file qquickdeliveryagent.cpp.

References eventsInDelivery, QList< T >::isEmpty(), and QStack< T >::top().

Referenced by removeGrabber().

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

◆ exclusiveGrabbers()

QList< QObject * > QQuickDeliveryAgentPrivate::exclusiveGrabbers ( QPointerEvent * ev)

Definition at line 1410 of file qquickdeliveryagent.cpp.

Referenced by deliverMatchingPointsToItem(), and deliverUpdatedPoints().

+ Here is the caller graph for this function:

◆ flushFrameSynchronousEvents()

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.

See also
qq-hover-event-delivery

Definition at line 1733 of file qquickdeliveryagent.cpp.

References currentEventDeliveryAgent, delayedTouch, deliverDelayedTouchEvent(), deliverHoverEvent(), frameSynchronousHoverEnabled, QQuickWindowPrivate::get(), QQmlAnimationTimer::instance(), QPointF::isNull(), QGuiApplication::keyboardModifiers(), lastMousePosition, QQuickDeliveryAgent::Transform::map(), Q_UNLIKELY, Q_UNUSED, qCDebug, qCWarning, rootItem, sceneTransform, win, and QQuickItem::window().

Referenced by QQuickRenderControl::polishItems(), QSGOpenVGRenderLoop::renderWindow(), QSGGuiThreadRenderLoop::renderWindow(), and QSGSoftwareRenderLoop::renderWindow().

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

◆ focusTargetItem()

QQuickItem * QQuickDeliveryAgentPrivate::focusTargetItem ( ) const

Returns the item that should get active focus when the root focus scope gets active focus.

Definition at line 659 of file qquickdeliveryagent.cpp.

References activeFocusItem, QQuickItem::isEnabled(), QQuickItem::isFocusScope(), Q_ASSERT, rootItem, and QQuickItem::scopedFocusItem().

+ Here is the call graph for this function:

◆ handleMouseEvent()

void QQuickDeliveryAgentPrivate::handleMouseEvent ( QMouseEvent * event)

Handle event on behalf of this delivery agent's window or subscene.

Definition at line 1662 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().

+ Here is the call graph for this function:

◆ handleTouchEvent()

void QQuickDeliveryAgentPrivate::handleTouchEvent ( QTouchEvent * event)

Definition at line 1627 of file qquickdeliveryagent.cpp.

References compressTouchEvent(), delayedTouch, deliverDelayedTouchEvent(), deliverPointerEvent(), lastMousePosition, pointerEventRecursionGuard, qCDebug, qEnvironmentVariableIsSet(), QEventPoint::Released, and translateTouchEvent().

+ Here is the call graph for this function:

◆ handleWindowDeactivate()

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 1347 of file qquickdeliveryagent.cpp.

References device, QInputDevice::devices(), QPointingDevicePrivate::get(), item, qCDebug, win, and QGraphicsItem::window().

+ Here is the call graph for this function:

◆ handleWindowHidden()

void QQuickDeliveryAgentPrivate::handleWindowHidden ( QQuickWindow * win)

Definition at line 1378 of file qquickdeliveryagent.cpp.

References clearHover(), lastMousePosition, qCDebug, and win.

+ Here is the call graph for this function:

◆ isDeliveringTouchAsMouse()

bool QQuickDeliveryAgentPrivate::isDeliveringTouchAsMouse ( ) const
inline

Definition at line 111 of file qquickdeliveryagent_p_p.h.

Referenced by deliverPressOrReleaseEvent(), mousePointData(), and onGrabChanged().

+ Here is the caller graph for this function:

◆ isEventFromMouseOrTouchpad()

◆ isHoverEvent()

bool QQuickDeliveryAgentPrivate::isHoverEvent ( const QPointerEvent * ev)
static

◆ isMouseEvent()

◆ isMouseOrWheelEvent()

bool QQuickDeliveryAgentPrivate::isMouseOrWheelEvent ( const QPointerEvent * ev)
static

Definition at line 1453 of file qquickdeliveryagent.cpp.

References isMouseEvent(), and QEvent::Wheel.

Referenced by QQuickItemPrivate::handlePointerEvent().

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

◆ isSynthMouse()

bool QQuickDeliveryAgentPrivate::isSynthMouse ( const QPointerEvent * ev)
static

Definition at line 1504 of file qquickdeliveryagent.cpp.

References isEventFromMouseOrTouchpad(), and isMouseEvent().

Referenced by QQuickWindow::event().

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

◆ isTabletEvent()

bool QQuickDeliveryAgentPrivate::isTabletEvent ( const QPointerEvent * ev)
static

Definition at line 1483 of file qquickdeliveryagent.cpp.

References QEvent::TabletEnterProximity, QEvent::TabletLeaveProximity, QEvent::TabletMove, QEvent::TabletPress, and QEvent::TabletRelease.

Referenced by QQuickWindowPrivate::clearGrabbers(), deliverPointerEvent(), QQuickFlickable::filterPointerEvent(), QQuickHoverHandler::handleEventPoint(), QQuickHandlerPoint::reset(), and QQuickTapHandler::wantsEventPoint().

+ Here is the caller graph for this function:

◆ isTouchEvent()

◆ localizePointerEvent()

void QQuickDeliveryAgentPrivate::localizePointerEvent ( QPointerEvent * ev,
const QQuickItem * dest )
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 1400 of file qquickdeliveryagent.cpp.

References i, QQuickItem::mapFromScene(), QQuickItem::mapToScene(), and qCDebug.

Referenced by QQuickFlickable::childMouseEventFilter(), deliverMatchingPointsToItem(), deliverSinglePointEventUntilAccepted(), deliverToPassiveGrabbers(), deliverUpdatedPoints(), and sendFilteredPointerEventImpl().

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

◆ mergePointerTargets()

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 2061 of file qquickdeliveryagent.cpp.

References QList< T >::at(), i, list2, Q_ASSERT, and QList< T >::size().

Referenced by deliverPressOrReleaseEvent(), and deliverUpdatedPoints().

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

◆ mousePointData()

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 121 of file qquickdeliveryagent.cpp.

References eventsInDelivery, QPointingDevicePrivate::get(), isDeliveringTouchAsMouse(), QList< T >::isEmpty(), QPointerEvent::pointingDevice(), QStack< T >::top(), and touchMouseId.

Referenced by removeGrabber().

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

◆ notifyFocusChangesRecur()

void QQuickDeliveryAgentPrivate::notifyFocusChangesRecur ( QQuickItem ** item,
int remaining,
Qt::FocusReason reason )
static

Definition at line 596 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().

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

◆ onGrabChanged()

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 1787 of file qquickdeliveryagent.cpp.

References QPointingDevice::CancelGrabExclusive, QPointingDevice::CancelGrabPassive, currentEventDeliveryAgent, QEventPoint::device, QPointingDevicePrivate::get(), QQuickItemPrivate::get(), QPointingDevice::GrabExclusive, QPointingDevice::GrabPassive, hasFiltered, QEventPoint::id, isDeliveringTouchAsMouse(), isSubsceneAgent, lastUngrabbed, QInputDevice::Mouse, QQuickItem::mouseUngrabEvent(), QPointingDevice::OverrideGrabPassive, Q_ASSERT, qCDebug, QEventPoint::Released, sendFilteredMouseEvent(), QPointingDevicePrivate::setPassiveGrabberContext(), QInputDevice::TouchPad, QInputDevice::TouchScreen, QInputDevice::type, QPointingDevice::UngrabExclusive, QEvent::UngrabMouse, and QPointingDevice::UngrabPassive.

Referenced by ensureDeviceConnected().

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

◆ pointerTargets()

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. \list

  • If an item has pointer handlers, call QQuickPointerHandler::wantsEventPoint() on every handler to decide whether the item is eligible.
  • Otherwise, if checkMouseButtons is true, it means we are finding targets for a mouse event, so no item for which acceptedMouseButtons() is NoButton will be added.
  • Otherwise, if checkAcceptsTouch is 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.
  • If QQuickItem::clip() is 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.)
  • Ignore any item in a subscene that "belongs to" a different DeliveryAgent. (In current practice, this only happens in 2D scenes in Qt Quick 3D.) \endlist

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 2008 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().

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

◆ removeGrabber()

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 263 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(), and QInputDevice::TouchScreen.

+ Here is the call graph for this function:

◆ sendFilteredMouseEvent()

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 2741 of file qquickdeliveryagent.cpp.

References QQuickItemPrivate::get(), hasFiltered, QQuickItem::parentItem(), qCDebug, sendFilteredMouseEvent(), and skipDelivery.

Referenced by onGrabChanged(), sendFilteredMouseEvent(), and sendHoverEvent().

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

◆ sendFilteredPointerEvent()

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 2597 of file qquickdeliveryagent.cpp.

References QQuickItem::parentItem(), and sendFilteredPointerEventImpl().

Referenced by deliverMatchingPointsToItem(), deliverPressOrReleaseEvent(), deliverToPassiveGrabbers(), and deliverUpdatedPoints().

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

◆ sendFilteredPointerEventImpl()

◆ sendHoverEvent()

bool QQuickDeliveryAgentPrivate::sendHoverEvent ( QEvent::Type type,
QQuickItem * item,
const QPointF & scenePos,
const QPointF & lastScenePos,
Qt::KeyboardModifiers modifiers,
ulong timestamp )

Definition at line 1008 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().

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

◆ setFocusInScope()

void QQuickDeliveryAgentPrivate::setFocusInScope ( QQuickItem * scope,
QQuickItem * item,
Qt::FocusReason reason,
FocusOptions options = { } )

◆ touchToMouseEvent()

void QQuickDeliveryAgentPrivate::touchToMouseEvent ( QEvent::Type type,
const QEventPoint & p,
const QTouchEvent * touchEvent,
QMutableSinglePointEvent * mouseEvent )

Definition at line 58 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, QPointerEvent::setAccepted(), QCoreApplication::testAttribute(), and QInputDevice::type.

Referenced by deliverTouchAsMouse(), and sendFilteredPointerEventImpl().

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

◆ translateTouchEvent()

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 303 of file qquickdeliveryagent.cpp.

References i, and QTest::QTouchEventSequence::point().

Referenced by handleTouchEvent().

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

◆ updateFocusItemTransform()

void QQuickDeliveryAgentPrivate::updateFocusItemTransform ( )

Definition at line 643 of file qquickdeliveryagent.cpp.

References activeFocusItem, QGuiApplication::focusObject(), QQuickItemPrivate::get(), Qt::ImInputItemClipRectangle, and QGuiApplication::inputMethod().

Referenced by clearFocusInScope(), QQuickWindowPrivate::polishItems(), and setFocusInScope().

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

Member Data Documentation

◆ activeFocusItem

QQuickItem* QQuickDeliveryAgentPrivate::activeFocusItem = nullptr

◆ allowChildEventFiltering

bool QQuickDeliveryAgentPrivate::allowChildEventFiltering = true

Definition at line 90 of file qquickdeliveryagent_p_p.h.

Referenced by sendFilteredPointerEventImpl().

◆ compressedTouchCount

uchar QQuickDeliveryAgentPrivate::compressedTouchCount = 0

Definition at line 89 of file qquickdeliveryagent_p_p.h.

Referenced by compressTouchEvent(), and deliverDelayedTouchEvent().

◆ currentEventDeliveryAgent

◆ currentHoverId

uint QQuickDeliveryAgentPrivate::currentHoverId = 0

Definition at line 85 of file qquickdeliveryagent_p_p.h.

Referenced by deliverHoverEvent(), and deliverHoverEventToItem().

◆ delayedTouch

std::unique_ptr<QMutableTouchEvent> QQuickDeliveryAgentPrivate::delayedTouch

◆ eventsInDelivery

QStack<QPointerEvent *> QQuickDeliveryAgentPrivate::eventsInDelivery

◆ frameSynchronousHoverEnabled

bool QQuickDeliveryAgentPrivate::frameSynchronousHoverEnabled = true

Definition at line 91 of file qquickdeliveryagent_p_p.h.

Referenced by flushFrameSynchronousEvents().

◆ hasFiltered

◆ hoveredLeafItemFound

bool QQuickDeliveryAgentPrivate::hoveredLeafItemFound = false

◆ hoverItems

QFlatMap<QPointer<QQuickItem>, uint> QQuickDeliveryAgentPrivate::hoverItems

◆ isSubsceneAgent

◆ knownPointingDevices

QList<const QPointingDevice *> QQuickDeliveryAgentPrivate::knownPointingDevices

Definition at line 83 of file qquickdeliveryagent_p_p.h.

Referenced by ensureDeviceConnected(), and removeGrabber().

◆ lastFocusReason

Qt::FocusReason QQuickDeliveryAgentPrivate::lastFocusReason = Qt::OtherFocusReason

Definition at line 100 of file qquickdeliveryagent_p_p.h.

Referenced by clearFocusInScope(), and setFocusInScope().

◆ lastMousePosition

QPointF QQuickDeliveryAgentPrivate::lastMousePosition

◆ lastUngrabbed

QQuickItem* QQuickDeliveryAgentPrivate::lastUngrabbed = nullptr

◆ pointerEventRecursionGuard

int QQuickDeliveryAgentPrivate::pointerEventRecursionGuard = 0

Definition at line 101 of file qquickdeliveryagent_p_p.h.

Referenced by deliverPointerEvent(), and handleTouchEvent().

◆ rootItem

◆ sceneTransform

QQuickDeliveryAgent::Transform* QQuickDeliveryAgentPrivate::sceneTransform = nullptr

◆ skipDelivery

QVector<QQuickItem *> QQuickDeliveryAgentPrivate::skipDelivery

◆ subsceneAgentsExist

bool QQuickDeliveryAgentPrivate::subsceneAgentsExist
static

Definition at line 95 of file qquickdeliveryagent_p_p.h.

Referenced by QQuickDeliveryAgentPrivate(), and QQuickWindow::event().

◆ touchMouseDevice

const QPointingDevice* QQuickDeliveryAgentPrivate::touchMouseDevice = nullptr

◆ touchMouseId

◆ touchMousePressPos

QPoint QQuickDeliveryAgentPrivate::touchMousePressPos

Definition at line 107 of file qquickdeliveryagent_p_p.h.

Referenced by checkIfDoubleTapped(), and deliverTouchAsMouse().

◆ touchMousePressTimestamp

ulong QQuickDeliveryAgentPrivate::touchMousePressTimestamp = 0

Definition at line 106 of file qquickdeliveryagent_p_p.h.

Referenced by checkIfDoubleTapped(), and deliverTouchAsMouse().


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