diff options
Diffstat (limited to 'src/quick/items/qquickitem.cpp')
-rw-r--r-- | src/quick/items/qquickitem.cpp | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index 8102a473db..008c078f5d 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -4087,8 +4087,9 @@ void QQuickItem::mouseReleaseEvent(QMouseEvent *event) \input item.qdocinc accepting-events */ -void QQuickItem::mouseDoubleClickEvent(QMouseEvent *) +void QQuickItem::mouseDoubleClickEvent(QMouseEvent *event) { + event->ignore(); } /*! @@ -5521,20 +5522,26 @@ bool QQuickItemPrivate::anyPointerHandlerWants(const QPointerEvent *event, const /*! \internal - Deliver the \a event to all PointerHandlers which are in the pre-determined - eventDeliveryTargets() vector. If \a avoidExclusiveGrabber is true, it skips - delivery to any handler which is the exclusive grabber of any point within this event - (because delivery to exclusive grabbers is handled separately). + Deliver the \a event to all this item's PointerHandlers, but skip + HoverHandlers if the event is a QMouseEvent (they are visited in + QQuickDeliveryAgentPrivate::deliverHoverEventToItem()), and skip handlers + that are in QQuickPointerHandlerPrivate::deviceDeliveryTargets(). + If \a avoidGrabbers is true, also skip delivery to any handler that + is exclusively or passively grabbing any point within \a event + (because delivery to grabbers is handled separately). */ -bool QQuickItemPrivate::handlePointerEvent(QPointerEvent *event, bool avoidExclusiveGrabber) +bool QQuickItemPrivate::handlePointerEvent(QPointerEvent *event, bool avoidGrabbers) { bool delivered = false; if (extra.isAllocated()) { for (QQuickPointerHandler *handler : extra->pointerHandlers) { bool avoidThisHandler = false; - if (avoidExclusiveGrabber) { + if (QQuickDeliveryAgentPrivate::isMouseEvent(event) && + qmlobject_cast<const QQuickHoverHandler *>(handler)) { + avoidThisHandler = true; + } else if (avoidGrabbers) { for (auto &p : event->points()) { - if (event->exclusiveGrabber(p) == handler) { + if (event->exclusiveGrabber(p) == handler || event->passiveGrabbers(p).contains(handler)) { avoidThisHandler = true; break; } @@ -9508,7 +9515,9 @@ void QQuickItemLayer::updateGeometry() { QQuickItem *l = m_effect ? (QQuickItem *) m_effect : (QQuickItem *) m_effectSource; Q_ASSERT(l); - QRectF bounds = m_item->boundingRect(); + // Avoid calling QQuickImage::boundingRect() or other overrides + // which may not be up-to-date at this time (QTBUG-104442, 104536) + QRectF bounds = m_item->QQuickItem::boundingRect(); l->setSize(bounds.size()); l->setPosition(bounds.topLeft() + m_item->position()); } |