From 67405c1b4d8ae5b47191ff1c28606453bf52295c Mon Sep 17 00:00:00 2001 From: Niklas Kurkisuo Date: Wed, 9 Feb 2011 13:56:00 +0100 Subject: Stop focus propagation of touch events when flag is set. Added check to stop propagation of touch events for items that have the QGraphicsItem::ItemStopsClickFocusPropagation flag set. Merge-request: 1085 Reviewed-by: Harald Fernengel --- src/gui/graphicsview/qgraphicsscene.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 5e5077b..069f4dd 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -5941,6 +5941,8 @@ bool QGraphicsScenePrivate::sendTouchBeginEvent(QGraphicsItem *origin, QTouchEve } if (item->isPanel()) break; + if (item->d_ptr->flags & QGraphicsItem::ItemStopsClickFocusPropagation) + break; } // If nobody could take focus, clear it. @@ -5973,6 +5975,8 @@ bool QGraphicsScenePrivate::sendTouchBeginEvent(QGraphicsItem *origin, QTouchEve } if (item && item->isPanel()) break; + if (item && (item->d_ptr->flags & QGraphicsItem::ItemStopsClickFocusPropagation)) + break; } touchEvent->setAccepted(eventAccepted); -- cgit v0.12