summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsview.cpp
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2010-05-14 09:27:47 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2010-05-18 12:44:07 (GMT)
commit28ad286c3e2df7e391d4e5cbe41958c9be12d900 (patch)
tree7c17b3a4058362dfb9fa0138efb41e2335e4622b /src/gui/graphicsview/qgraphicsview.cpp
parent74993e0fd685c905fff1f9e21a190b3531107f20 (diff)
downloadQt-28ad286c3e2df7e391d4e5cbe41958c9be12d900.zip
Qt-28ad286c3e2df7e391d4e5cbe41958c9be12d900.tar.gz
Qt-28ad286c3e2df7e391d4e5cbe41958c9be12d900.tar.bz2
Gestures in GraphicsView do not require a viewport to subscribe to gestures.
When a graphicsitem subscribes to a gesture the viewport is implicitly subscribed to it as well. Task-number: QTBUG-9849 Reviewed-by: Olivier Goffart Reviewed-by: Mikko Harju
Diffstat (limited to 'src/gui/graphicsview/qgraphicsview.cpp')
-rw-r--r--src/gui/graphicsview/qgraphicsview.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp
index d2964ca..9dfcd2c 100644
--- a/src/gui/graphicsview/qgraphicsview.cpp
+++ b/src/gui/graphicsview/qgraphicsview.cpp
@@ -2688,6 +2688,11 @@ void QGraphicsView::setupViewport(QWidget *widget)
if (d->scene && !d->scene->d_func()->allItemsIgnoreTouchEvents)
widget->setAttribute(Qt::WA_AcceptTouchEvents);
+ if (d->scene) {
+ foreach (Qt::GestureType gesture, d->scene->d_func()->grabbedGestures.keys())
+ widget->grabGesture(gesture);
+ }
+
widget->setAcceptDrops(acceptDrops());
}