summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsitem.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-11-05 15:00:28 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-11-05 15:00:28 (GMT)
commitdaa4d04090c75ac8e64552f6d14834b2b79d2abb (patch)
tree3f4bbf6e2c7f42b18af124d2d35e1867238ca736 /src/gui/graphicsview/qgraphicsitem.cpp
parent8c7180dd0ed9bd13724c75dc26f0fb18b0f48e7c (diff)
parent4cd683231190443e5243f66098c7322e3808a131 (diff)
downloadQt-daa4d04090c75ac8e64552f6d14834b2b79d2abb.zip
Qt-daa4d04090c75ac8e64552f6d14834b2b79d2abb.tar.gz
Qt-daa4d04090c75ac8e64552f6d14834b2b79d2abb.tar.bz2
Merge commit 'origin/4.6' into 4.6
Diffstat (limited to 'src/gui/graphicsview/qgraphicsitem.cpp')
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index e014763..949f555 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -7408,19 +7408,32 @@ QGraphicsObject::QGraphicsObject(QGraphicsItemPrivate &dd, QGraphicsItem *parent
}
/*!
- Subscribes the graphics object to the given \a gesture for the specified \a context.
+ Subscribes the graphics object to the given \a gesture with specific \a flags.
- \sa QGestureEvent
+ \sa ungrabGesture(), QGestureEvent
*/
-
-void QGraphicsObject::grabGesture(Qt::GestureType gesture, Qt::GestureContext context)
+void QGraphicsObject::grabGesture(Qt::GestureType gesture, Qt::GestureFlags flags)
{
QGraphicsItemPrivate * const d = QGraphicsItem::d_func();
- d->gestureContext.insert(gesture, context);
+ d->gestureContext.insert(gesture, flags);
(void)QGestureManager::instance(); // create a gesture manager
}
/*!
+ Unsubscribes the graphics object from the given \a gesture.
+
+ \sa grabGesture(), QGestureEvent
+*/
+void QGraphicsObject::ungrabGesture(Qt::GestureType gesture)
+{
+ QGraphicsItemPrivate * const d = QGraphicsItem::d_func();
+ if (d->gestureContext.remove(gesture)) {
+ QGestureManager *manager = QGestureManager::instance();
+ manager->cleanupCachedGestures(this, gesture);
+ }
+}
+
+/*!
\property QGraphicsObject::parent
\brief the parent of the item