summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2009-06-11 12:57:55 (GMT)
committerBradley T. Hughes <bradley.hughes@nokia.com>2009-06-11 12:57:55 (GMT)
commit144154046529e557616738c13b3721e3cab77301 (patch)
tree54c5191ea86a0c5954accace75605805888b303a /src/gui/graphicsview
parent0218d8f8dc569db9a1290f595a814c3690c1b14b (diff)
downloadQt-144154046529e557616738c13b3721e3cab77301.zip
Qt-144154046529e557616738c13b3721e3cab77301.tar.gz
Qt-144154046529e557616738c13b3721e3cab77301.tar.bz2
make sure touch events are enabled on the view's viewport when items are interested in touch events
this is a continuation of 0218d8f8dc569db9a1290f595a814c3690c1b14b
Diffstat (limited to 'src/gui/graphicsview')
-rw-r--r--src/gui/graphicsview/qgraphicsview.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp
index ab7d7ab..cc16ebc 100644
--- a/src/gui/graphicsview/qgraphicsview.cpp
+++ b/src/gui/graphicsview/qgraphicsview.cpp
@@ -1533,6 +1533,10 @@ void QGraphicsView::setScene(QGraphicsScene *scene)
|| !d->scene->d_func()->allItemsUseDefaultCursor) {
d->viewport->setMouseTracking(true);
}
+
+ // enable touch events if any items is interested in them
+ if (!d->scene->d_func()->allItemsIgnoreTouchEvents)
+ d->viewport->setAttribute(Qt::WA_AcceptTouchEvents);
} else {
d->recalculateContentSize();
}
@@ -2616,6 +2620,11 @@ void QGraphicsView::setupViewport(QWidget *widget)
|| !d->scene->d_func()->allItemsUseDefaultCursor)) {
widget->setMouseTracking(true);
}
+
+ // enable touch events if any items is interested in them
+ if (d->scene && !d->scene->d_func()->allItemsIgnoreTouchEvents)
+ widget->setAttribute(Qt::WA_AcceptTouchEvents);
+
widget->setAcceptDrops(acceptDrops());
}