diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-10-30 10:56:16 (GMT) |
---|---|---|
committer | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-10-30 10:56:16 (GMT) |
commit | 6fbd9589cbe77c4d3213ba43c7e88fc451c9664e (patch) | |
tree | bfec32f37cdeed130731b758d4fe9fe14e2a8392 /src/gui/kernel/qgesturemanager_p.h | |
parent | 83fff2f970b9a7b41861336c7dca0eadbda28099 (diff) | |
parent | 8c4edbd04f350294462fd689748de2dd7cc84d47 (diff) | |
download | Qt-6fbd9589cbe77c4d3213ba43c7e88fc451c9664e.zip Qt-6fbd9589cbe77c4d3213ba43c7e88fc451c9664e.tar.gz Qt-6fbd9589cbe77c4d3213ba43c7e88fc451c9664e.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt-platform-team into 4.6
Diffstat (limited to 'src/gui/kernel/qgesturemanager_p.h')
-rw-r--r-- | src/gui/kernel/qgesturemanager_p.h | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/src/gui/kernel/qgesturemanager_p.h b/src/gui/kernel/qgesturemanager_p.h index f0e7225..4958cdb 100644 --- a/src/gui/kernel/qgesturemanager_p.h +++ b/src/gui/kernel/qgesturemanager_p.h @@ -79,16 +79,18 @@ public: // declared in qapplication.cpp static QGestureManager* instance(); + void cleanupCachedGestures(QObject *target, Qt::GestureType type); + protected: void timerEvent(QTimerEvent *event); - bool filterEventThroughContexts(const QMap<QObject *, Qt::GestureType> &contexts, + bool filterEventThroughContexts(const QMultiHash<QObject *, Qt::GestureType> &contexts, QEvent *event); private: - QMultiMap<Qt::GestureType, QGestureRecognizer *> recognizers; + QMultiMap<Qt::GestureType, QGestureRecognizer *> m_recognizers; - QSet<QGesture *> activeGestures; - QMap<QGesture *, QBasicTimer> maybeGestures; + QSet<QGesture *> m_activeGestures; + QHash<QGesture *, QBasicTimer> m_maybeGestures; enum State { Gesture, @@ -104,7 +106,7 @@ private: Qt::GestureType gesture; ObjectGesture(QObject *o, const Qt::GestureType &g) : object(o), gesture(g) { } - inline bool operator<(const ObjectGesture& rhs) const + inline bool operator<(const ObjectGesture &rhs) const { if (object.data() < rhs.object.data()) return true; @@ -114,20 +116,27 @@ private: } }; - QMap<ObjectGesture, QGesture *> objectGestures; - QMap<QGesture *, QGestureRecognizer *> gestureToRecognizer; - QHash<QGesture *, QObject *> gestureOwners; + QMap<ObjectGesture, QList<QGesture *> > m_objectGestures; + QHash<QGesture *, QGestureRecognizer *> m_gestureToRecognizer; + QHash<QGesture *, QObject *> m_gestureOwners; + + QHash<QGesture *, QWidget *> m_gestureTargets; - QHash<QGesture *, QWidget *> gestureTargets; + int m_lastCustomGestureId; - int lastCustomGestureId; + QHash<QGestureRecognizer *, QList<QGesture *> > m_obsoleteGestures; + QHash<QGesture *, QGestureRecognizer *> m_deletedRecognizers; + void cleanupGesturesForRemovedRecognizer(QGesture *gesture); - QGesture *getState(QObject *widget, Qt::GestureType gesture); + QGesture *getState(QObject *widget, QGestureRecognizer *recognizer, + Qt::GestureType gesture); void deliverEvents(const QSet<QGesture *> &gestures, QSet<QGesture *> *undeliveredGestures); void getGestureTargets(const QSet<QGesture*> &gestures, QMap<QWidget *, QList<QGesture *> > *conflicts, QMap<QWidget *, QList<QGesture *> > *normal); + + void cancelGesturesForChildren(QGesture *originatingGesture); }; QT_END_NAMESPACE |