diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-03-13 17:08:18 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-05-11 14:51:25 (GMT) |
commit | 86a160b083f9d43c07d42bbd7d2ef8b676552e38 (patch) | |
tree | cf809282c646ef327156a5ed5ae3fd4671c0e3e4 /src/gui/graphicsview/qgraphicssceneevent.h | |
parent | f8c5c2720b4a48dad0f68b83d9c494185e012cd1 (diff) | |
download | Qt-86a160b083f9d43c07d42bbd7d2ef8b676552e38.zip Qt-86a160b083f9d43c07d42bbd7d2ef8b676552e38.tar.gz Qt-86a160b083f9d43c07d42bbd7d2ef8b676552e38.tar.bz2 |
Modifications after the api review by Brad.
Gesture types are now separated to internal ones, which are listed as
enums (though they might be converted to strings internally), and
third party gestures which are referenced by strings.
From now on QGesture objects derive from QObject, which means third
party gesture recognizer developers can use QObjects property system
to store custom data inside QGesture without need to subclass it.
Some functions were renamed to show their purpose more clear.
Diffstat (limited to 'src/gui/graphicsview/qgraphicssceneevent.h')
-rw-r--r-- | src/gui/graphicsview/qgraphicssceneevent.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gui/graphicsview/qgraphicssceneevent.h b/src/gui/graphicsview/qgraphicssceneevent.h index d3899cd..4d88cda 100644 --- a/src/gui/graphicsview/qgraphicssceneevent.h +++ b/src/gui/graphicsview/qgraphicssceneevent.h @@ -317,19 +317,19 @@ public: QGraphicsSceneGestureEvent(); ~QGraphicsSceneGestureEvent(); - inline bool contains(const Qt::GestureType &type) const + inline bool contains(const QString &type) const { return gesture(type) != 0; } - inline QList<Qt::GestureType> gestureTypes() const + inline QList<QString> gestureTypes() const { return m_gestures.keys(); } - inline const QGesture* gesture(const Qt::GestureType &type) const + inline const QGesture* gesture(const QString &type) const { return m_gestures.value(type, QSharedPointer<QGesture>()).data(); } inline QList<QSharedPointer<QGesture> > gestures() const { return m_gestures.values(); } void setGestures(const QList<QSharedPointer<QGesture> > &gestures); - inline QSet<Qt::GestureType> cancelledGestures() const + inline QSet<QString> cancelledGestures() const { return m_cancelledGestures; } - void setCancelledGestures(const QSet<Qt::GestureType> &cancelledGestures) + void setCancelledGestures(const QSet<QString> &cancelledGestures) { m_cancelledGestures = cancelledGestures; } QPointF mapToScene(const QPoint &point) const; @@ -338,8 +338,8 @@ public: QPolygonF mapToItem(const QRect &rect, QGraphicsItem *item) const; protected: - QHash<Qt::GestureType, QSharedPointer<QGesture> > m_gestures; - QSet<Qt::GestureType> m_cancelledGestures; + QHash<QString, QSharedPointer<QGesture> > m_gestures; + QSet<QString> m_cancelledGestures; }; class QGraphicsSceneTouchEventPrivate; |