summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview/qgraphicssceneevent.cpp
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-05-11 10:18:08 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-05-11 14:52:06 (GMT)
commitfd55642d60b852fbd175a9ea7c1a2457c6f611aa (patch)
treef488aa9592f6a8c1a4b49d42937016e509a59748 /src/gui/graphicsview/qgraphicssceneevent.cpp
parent81a64345258f2f2ad5cf77355f7ecbd3ebad9734 (diff)
downloadQt-fd55642d60b852fbd175a9ea7c1a2457c6f611aa.zip
Qt-fd55642d60b852fbd175a9ea7c1a2457c6f611aa.tar.gz
Qt-fd55642d60b852fbd175a9ea7c1a2457c6f611aa.tar.bz2
Added accept* method to QGraphicsSceneGestureEvent as well.
Diffstat (limited to 'src/gui/graphicsview/qgraphicssceneevent.cpp')
-rw-r--r--src/gui/graphicsview/qgraphicssceneevent.cpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/gui/graphicsview/qgraphicssceneevent.cpp b/src/gui/graphicsview/qgraphicssceneevent.cpp
index 86825b1..9795fda 100644
--- a/src/gui/graphicsview/qgraphicssceneevent.cpp
+++ b/src/gui/graphicsview/qgraphicssceneevent.cpp
@@ -1890,6 +1890,54 @@ void QGraphicsSceneGestureEvent::setGestures(const QList<QGesture*> &gestures)
m_gestures.insert(g->type(), g);
}
+/*!
+ Sets the accept flag of the all gestures inside the event object,
+ the equivalent of calling \l{QEvent::accept()}{accept()} or
+ \l{QEvent::setAccepted()}{setAccepted(true)}.
+
+ Setting the accept parameter indicates that the event receiver
+ wants the gesture. Unwanted gestures might be propagated to the parent
+ widget.
+*/
+void QGraphicsSceneGestureEvent::acceptAll()
+{
+ QHash<QString, QGesture*>::iterator it = m_gestures.begin(),
+ e = m_gestures.end();
+ for(; it != e; ++it)
+ it.value()->accept();
+ setAccepted(true);
+}
+
+/*!
+ Sets the accept flag of the specified gesture inside the event
+ object, the equivalent of calling
+ \l{QGestureEvent::gesture()}{gesture(type)}->\l{QGesture::accept()}{accept()}
+
+ Setting the accept parameter indicates that the event receiver
+ wants the gesture. Unwanted gestures might be propagated to the parent
+ widget.
+*/
+void QGraphicsSceneGestureEvent::accept(Qt::GestureType type)
+{
+ if (QGesture *g = m_gestures.value(qt_getStandardGestureTypeName(type), 0))
+ g->accept();
+}
+
+/*!
+ Sets the accept flag of the specified gesture inside the event
+ object, the equivalent of calling
+ \l{QGestureEvent::gesture()}{gesture(type)}->\l{QGesture::accept()}{accept()}
+
+ Setting the accept parameter indicates that the event receiver
+ wants the gesture. Unwanted gestures might be propagated to the parent
+ widget.
+*/
+void QGraphicsSceneGestureEvent::accept(const QString &type)
+{
+ if (QGesture *g = m_gestures.value(type, 0))
+ g->accept();
+}
+
class QGraphicsSceneTouchEventPrivate : public QGraphicsSceneEventPrivate
{
Q_DECLARE_PUBLIC(QGraphicsSceneTouchEvent)