diff options
Diffstat (limited to 'src/gui/kernel/qgesturemanager_p.h')
-rw-r--r-- | src/gui/kernel/qgesturemanager_p.h | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/src/gui/kernel/qgesturemanager_p.h b/src/gui/kernel/qgesturemanager_p.h index f0e7225..1e0734b 100644 --- a/src/gui/kernel/qgesturemanager_p.h +++ b/src/gui/kernel/qgesturemanager_p.h @@ -74,21 +74,25 @@ public: bool filterEvent(QWidget *receiver, QEvent *event); bool filterEvent(QGesture *receiver, QEvent *event); +#ifndef QT_NO_GRAPHICSVIEW bool filterEvent(QGraphicsObject *receiver, QEvent *event); +#endif //QT_NO_GRAPHICSVIEW // 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 +108,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 +118,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 |