summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2010-02-09 09:50:27 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2010-02-12 12:34:44 (GMT)
commit43233652e753ffa2b97a8b6d56ae53bb02cbad6b (patch)
treeb007ca73969ae36f803c7646cf1844f15208210b /src/gui/graphicsview
parent3d968f8bb2abd378eea8c056da5cb7e90f2f05ed (diff)
downloadQt-43233652e753ffa2b97a8b6d56ae53bb02cbad6b.zip
Qt-43233652e753ffa2b97a8b6d56ae53bb02cbad6b.tar.gz
Qt-43233652e753ffa2b97a8b6d56ae53bb02cbad6b.tar.bz2
Implemented GraphicsView Panel support for gestures.
Events should not propagate outside the panel. Also when delivering gesture events we should respect panels modality. Task-number: QTBUG-7451 Reviewed-by: Mikko Harju Reviewed-by: Bradley T. Hughes
Diffstat (limited to 'src/gui/graphicsview')
-rw-r--r--src/gui/graphicsview/qgraphicsscene.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp
index 66707fc..96d2435 100644
--- a/src/gui/graphicsview/qgraphicsscene.cpp
+++ b/src/gui/graphicsview/qgraphicsscene.cpp
@@ -5902,13 +5902,21 @@ void QGraphicsScenePrivate::getGestureTargets(const QSet<QGesture *> &gestures,
QList<QGraphicsItem *> items = itemsAtPosition(screenPos, QPointF(), viewport);
QList<QGraphicsObject *> result;
for (int j = 0; j < items.size(); ++j) {
- QGraphicsObject *item = items.at(j)->toGraphicsObject();
- if (!item)
- continue;
- QGraphicsItemPrivate *d = item->QGraphicsItem::d_func();
- if (d->gestureContext.contains(gestureType)) {
- result.append(item);
+ QGraphicsItem *item = items.at(j);
+
+ // Check if the item is blocked by a modal panel and use it as
+ // a target instead of this item.
+ (void) item->isBlockedByModalPanel(&item);
+
+ if (QGraphicsObject *itemobj = item->toGraphicsObject()) {
+ QGraphicsItemPrivate *d = item->d_func();
+ if (d->gestureContext.contains(gestureType)) {
+ result.append(itemobj);
+ }
}
+ // Don't propagate through panels.
+ if (item->isPanel())
+ break;
}
DEBUG() << "QGraphicsScenePrivate::getGestureTargets:"
<< gesture << result;