From be18d6fb01749184d40cdcd079e685d220ff8b80 Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Thu, 18 Sep 2014 16:16:26 +0400 Subject: Fix shortcuts with keypad keys The way of searching a shortcut match for a key without the keypad modifier introduced in 547a1bea492954d828aa0798be93384669812489 is not correct. QKeyEvent::setModifiers() doesn't change native scan code so we get the incorrect QKeyEvent object which is eventually passed to the implementation of QPlatformIntegration::possibleKeys(). And then QPlatformIntegration::possibleKeys() returns the same result as for the original QKeyEvent object. So to fix it we have to remove Qt::KeypadModifier from keys after calling the implementation of QPlatformIntegration::possibleKeys(), as it was before 547a1bea492954d828aa0798be93384669812489. Task-number: QTBUG-33093 Task-number: QTBUG-44577 Change-Id: I5b33c9b6cf2c06b133166a31eba9aff9181c9483 Reviewed-by: Gunnar Sletta --- src/gui/kernel/qshortcutmap_p.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gui/kernel/qshortcutmap_p.h') diff --git a/src/gui/kernel/qshortcutmap_p.h b/src/gui/kernel/qshortcutmap_p.h index 242c021ca4..2376d27c78 100644 --- a/src/gui/kernel/qshortcutmap_p.h +++ b/src/gui/kernel/qshortcutmap_p.h @@ -88,10 +88,10 @@ private: QKeySequence::SequenceMatch state(); void dispatchEvent(QKeyEvent *e); - QKeySequence::SequenceMatch find(QKeyEvent *e); + QKeySequence::SequenceMatch find(QKeyEvent *e, int ignoredModifiers = 0); QKeySequence::SequenceMatch matches(const QKeySequence &seq1, const QKeySequence &seq2) const; QVector matches() const; - void createNewSequences(QKeyEvent *e, QVector &ksl); + void createNewSequences(QKeyEvent *e, QVector &ksl, int ignoredModifiers); void clearSequence(QVector &ksl); int translateModifiers(Qt::KeyboardModifiers modifiers); -- cgit v1.2.3