summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicsitem.cpp
diff options
context:
space:
mode:
authorFrans Englich <frans.englich@nokia.com>2009-11-04 14:48:40 (GMT)
committerFrans Englich <frans.englich@nokia.com>2009-11-04 14:48:40 (GMT)
commitb4ef8b906c88e5d60e687d9018af93de0e735e0c (patch)
treefe4167319039047ba3ac0c97651dddc0a526349b /src/gui/graphicsview/qgraphicsitem.cpp
parentf4f6012d181cf60fd04fc5bf69b21786977f0de0 (diff)
parent9cda9fb4bb496a7c589767bdcead131dbcdeeb79 (diff)
downloadQt-b4ef8b906c88e5d60e687d9018af93de0e735e0c.zip
Qt-b4ef8b906c88e5d60e687d9018af93de0e735e0c.tar.gz
Qt-b4ef8b906c88e5d60e687d9018af93de0e735e0c.tar.bz2
Merge commit 's60/4.6' into mmfphonon
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 d70b039..2fd499d 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -7343,19 +7343,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