diff options
Diffstat (limited to 'src/widgets/kernel/qgesturemanager.cpp')
-rw-r--r-- | src/widgets/kernel/qgesturemanager.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/widgets/kernel/qgesturemanager.cpp b/src/widgets/kernel/qgesturemanager.cpp index 8b918a72a2..fb2914d53a 100644 --- a/src/widgets/kernel/qgesturemanager.cpp +++ b/src/widgets/kernel/qgesturemanager.cpp @@ -66,7 +66,7 @@ static inline int panTouchPoints() static const char panTouchPointVariable[] = "QT_PAN_TOUCHPOINTS"; if (qEnvironmentVariableIsSet(panTouchPointVariable)) { bool ok; - const int result = qgetenv(panTouchPointVariable).toInt(&ok); + const int result = qEnvironmentVariableIntValue(panTouchPointVariable, &ok); if (ok && result >= 1) return result; qWarning() << "Ignoring invalid value of " << panTouchPointVariable; @@ -572,18 +572,19 @@ void QGestureManager::getGestureTargets(const QSet<QGesture*> &gestures, } // for each gesture type - foreach (Qt::GestureType type, gestureByTypes.keys()) { - QHash<QWidget *, QGesture *> gestures = gestureByTypes.value(type); - foreach (QWidget *widget, gestures.keys()) { + for (GestureByTypes::const_iterator git = gestureByTypes.cbegin(), gend = gestureByTypes.cend(); git != gend; ++git) { + const QHash<QWidget *, QGesture *> &gestures = git.value(); + for (QHash<QWidget *, QGesture *>::const_iterator wit = gestures.cbegin(), wend = gestures.cend(); wit != wend; ++wit) { + QWidget *widget = wit.key(); QWidget *w = widget->parentWidget(); while (w) { QMap<Qt::GestureType, Qt::GestureFlags>::const_iterator it - = w->d_func()->gestureContext.constFind(type); + = w->d_func()->gestureContext.constFind(git.key()); if (it != w->d_func()->gestureContext.constEnd()) { // i.e. 'w' listens to gesture 'type' if (!(it.value() & Qt::DontStartGestureOnChildren) && w != widget) { // conflicting gesture! - (*conflicts)[widget].append(gestures[widget]); + (*conflicts)[widget].append(wit.value()); break; } } @@ -594,7 +595,7 @@ void QGestureManager::getGestureTargets(const QSet<QGesture*> &gestures, w = w->parentWidget(); } if (!w) - (*normal)[widget].append(gestures[widget]); + (*normal)[widget].append(wit.value()); } } } |