diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-05-19 01:15:14 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-05-19 01:15:14 (GMT) |
commit | 1226fa946170caa7e30ffd1bf64e806a34139978 (patch) | |
tree | 4b515f0a2e8090ba951383e951f1763933a7fc9c /src/gui/kernel/qgesturemanager.cpp | |
parent | 6d6b7b318a842ef5037065554f30ebfb4ae34d74 (diff) | |
parent | df9ab6c300eca3a5c75dcee93ae848957cb9a617 (diff) | |
download | Qt-1226fa946170caa7e30ffd1bf64e806a34139978.zip Qt-1226fa946170caa7e30ffd1bf64e806a34139978.tar.gz Qt-1226fa946170caa7e30ffd1bf64e806a34139978.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1:
Only setup ICD test data when ICD is enabled.
Doc: Fixed two diagrams and finally committed images for them.
Make sure cursorPositionChanged is emitted when doing undo/redo
Some more 4.7.0 changes
Fix cosmetic issue in designer filter edits
Doc: Adding support for IE 6, 7 and 8
doc: Updated the widgets tutorial to work without page links.
My 4.7.0 changes
Added support for es_419 locale.
Added Korean and Nynorsk locales support on Symbian.
Gestures in GraphicsView do not require a viewport to subscribe to gestures.
Upgraded QLocale to Unicode CLDR 1.8.1
Removed the "maybe" timer from gesturemanager.
Fixes a crash and a memory leak in gesturemanager.
Embedded changes for 4.7
Added a default value for optimization settings.
Update Polish translations
Diffstat (limited to 'src/gui/kernel/qgesturemanager.cpp')
-rw-r--r-- | src/gui/kernel/qgesturemanager.cpp | 46 |
1 files changed, 9 insertions, 37 deletions
diff --git a/src/gui/kernel/qgesturemanager.cpp b/src/gui/kernel/qgesturemanager.cpp index 9495f40..43facef 100644 --- a/src/gui/kernel/qgesturemanager.cpp +++ b/src/gui/kernel/qgesturemanager.cpp @@ -161,8 +161,10 @@ void QGestureManager::cleanupCachedGestures(QObject *target, Qt::GestureType typ it = m_obsoleteGestures.begin(), e = m_obsoleteGestures.end(); it != e; ++it) { it.value() -= gestures; } - foreach (QGesture *g, gestures) + foreach (QGesture *g, gestures) { m_deletedRecognizers.remove(g); + m_gestureToRecognizer.remove(g); + } qDeleteAll(gestures); iter = m_objectGestures.erase(iter); } else { @@ -286,24 +288,14 @@ bool QGestureManager::filterEventThroughContexts(const QMultiMap<QObject *, // i.e. were canceled QSet<QGesture *> canceledGestures = m_activeGestures & notGestures; - // start timers for new gestures in maybe state - foreach (QGesture *state, newMaybeGestures) { - QBasicTimer &timer = m_maybeGestures[state]; - if (!timer.isActive()) - timer.start(3000, this); - } - // kill timers for gestures that were in maybe state + // new gestures in maybe state + m_maybeGestures += newMaybeGestures; + + // gestures that were in maybe state QSet<QGesture *> notMaybeGestures = (startedGestures | triggeredGestures | finishedGestures | canceledGestures | notGestures); - foreach(QGesture *gesture, notMaybeGestures) { - QHash<QGesture *, QBasicTimer>::iterator it = - m_maybeGestures.find(gesture); - if (it != m_maybeGestures.end()) { - it.value().stop(); - m_maybeGestures.erase(it); - } - } + m_maybeGestures -= notMaybeGestures; Q_ASSERT((startedGestures & finishedGestures).isEmpty()); Q_ASSERT((startedGestures & newMaybeGestures).isEmpty()); @@ -347,7 +339,7 @@ bool QGestureManager::filterEventThroughContexts(const QMultiMap<QObject *, !finishedGestures.isEmpty() || !canceledGestures.isEmpty()) { DEBUG() << "QGestureManager::filterEventThroughContexts:" << "\n\tactiveGestures:" << m_activeGestures - << "\n\tmaybeGestures:" << m_maybeGestures.keys() + << "\n\tmaybeGestures:" << m_maybeGestures << "\n\tstarted:" << startedGestures << "\n\ttriggered:" << triggeredGestures << "\n\tfinished:" << finishedGestures @@ -686,26 +678,6 @@ void QGestureManager::deliverEvents(const QSet<QGesture *> &gestures, } } -void QGestureManager::timerEvent(QTimerEvent *event) -{ - QHash<QGesture *, QBasicTimer>::iterator it = m_maybeGestures.begin(), - e = m_maybeGestures.end(); - for (; it != e; ) { - QBasicTimer &timer = it.value(); - Q_ASSERT(timer.isActive()); - if (timer.timerId() == event->timerId()) { - timer.stop(); - QGesture *gesture = it.key(); - it = m_maybeGestures.erase(it); - DEBUG() << "QGestureManager::timerEvent: gesture stopped due to timeout:" - << gesture; - recycle(gesture); - } else { - ++it; - } - } -} - void QGestureManager::recycle(QGesture *gesture) { QGestureRecognizer *recognizer = m_gestureToRecognizer.value(gesture, 0); |