summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qshortcutmap.cpp
diff options
context:
space:
mode:
authorjasplin <qt-info@nokia.com>2009-04-23 12:26:19 (GMT)
committerjasplin <qt-info@nokia.com>2009-04-23 12:36:09 (GMT)
commitb51dd5a7b328291c5dbda540ce228e7d867662cb (patch)
tree2ba45f66aec3d27d9881d6ec1d655d31deaf0de2 /src/gui/kernel/qshortcutmap.cpp
parentaa234610048a741cddc991be25b84d235f40e345 (diff)
downloadQt-b51dd5a7b328291c5dbda540ce228e7d867662cb.zip
Qt-b51dd5a7b328291c5dbda540ce228e7d867662cb.tar.gz
Qt-b51dd5a7b328291c5dbda540ce228e7d867662cb.tar.bz2
Revert "Fixed key sequence eating behavior for QShortcut and QAction."
This reverts commit 031adeaf42ddaef8d01338f6c59ba97170be5d53. The patch had some unforeseen side-effects for Creator. It may also affect other existing applications in a similar way. For now, this behavior (eating key sequences for disabled shortcuts) should be achieved using a local workaround in creator. Reviewed-by: mariusSO Task-number: 251246
Diffstat (limited to 'src/gui/kernel/qshortcutmap.cpp')
-rw-r--r--src/gui/kernel/qshortcutmap.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gui/kernel/qshortcutmap.cpp b/src/gui/kernel/qshortcutmap.cpp
index 415d71e..1babeb6 100644
--- a/src/gui/kernel/qshortcutmap.cpp
+++ b/src/gui/kernel/qshortcutmap.cpp
@@ -368,8 +368,9 @@ bool QShortcutMap::tryShortcutEvent(QObject *o, QKeyEvent *e)
default:
break;
}
-
- return true;
+ // If nextState is QKeySequence::ExactMatch && identicals.count == 0
+ // we've only found disabled shortcuts
+ return identicalMatches > 0 || result == QKeySequence::PartialMatch;
}
/*! \internal
@@ -491,7 +492,9 @@ QKeySequence::SequenceMatch QShortcutMap::find(QKeyEvent *e)
// We don't need partials, if we have identicals
if (d->identicals.size())
break;
- partialFound = true;
+ // We only care about enabled partials, so we don't consume
+ // key events when all partials are disabled!
+ partialFound |= (*it).enabled;
}
}
++it;