qt5-qtbase/qtbase-opensource-src-5.4.1-QTBUG-33093.patch

65 lines
3.2 KiB
Diff
Raw Normal View History

diff -up qtbase-opensource-src-5.4.1/src/gui/kernel/qshortcutmap.cpp.QTBUG-33093 qtbase-opensource-src-5.4.1/src/gui/kernel/qshortcutmap.cpp
--- qtbase-opensource-src-5.4.1/src/gui/kernel/qshortcutmap.cpp.QTBUG-33093 2015-02-16 22:56:48.000000000 -0600
+++ qtbase-opensource-src-5.4.1/src/gui/kernel/qshortcutmap.cpp 2015-05-06 14:29:44.991086570 -0500
@@ -380,9 +380,7 @@ QKeySequence::SequenceMatch QShortcutMap
result = find(e);
if (result == QKeySequence::NoMatch && (e->modifiers() & Qt::KeypadModifier)) {
// Try to find a match without keypad modifier
- QKeyEvent event = *e;
- event.setModifiers(e->modifiers() & ~Qt::KeypadModifier);
- result = find(&event);
+ result = find(e, Qt::KeypadModifier);
}
if (result == QKeySequence::NoMatch && e->modifiers() & Qt::ShiftModifier) {
// If Shift + Key_Backtab, also try Shift + Qt::Key_Tab
@@ -435,13 +433,13 @@ bool QShortcutMap::hasShortcutForKeySequ
which can be access through matches().
\sa matches
*/
-QKeySequence::SequenceMatch QShortcutMap::find(QKeyEvent *e)
+QKeySequence::SequenceMatch QShortcutMap::find(QKeyEvent *e, int ignoredModifiers)
{
Q_D(QShortcutMap);
if (!d->sequences.count())
return QKeySequence::NoMatch;
- createNewSequences(e, d->newEntries);
+ createNewSequences(e, d->newEntries, ignoredModifiers);
#if defined(DEBUG_QSHORTCUTMAP)
qDebug() << "Possible shortcut key sequences:" << d->newEntries;
#endif
@@ -543,7 +541,7 @@ void QShortcutMap::clearSequence(QVector
Alters \a seq to the new sequence state, based on the
current sequence state, and the new key event \a e.
*/
-void QShortcutMap::createNewSequences(QKeyEvent *e, QVector<QKeySequence> &ksl)
+void QShortcutMap::createNewSequences(QKeyEvent *e, QVector<QKeySequence> &ksl, int ignoredModifiers)
{
Q_D(QShortcutMap);
QList<int> possibleKeys = QKeyMapper::possibleKeys(e);
@@ -573,7 +571,7 @@ void QShortcutMap::createNewSequences(QK
curKsl.setKey(0, 2);
curKsl.setKey(0, 3);
}
- curKsl.setKey(possibleKeys.at(pkNum), index);
+ curKsl.setKey(possibleKeys.at(pkNum) & ~ignoredModifiers, index);
}
}
}
diff -up qtbase-opensource-src-5.4.1/src/gui/kernel/qshortcutmap_p.h.QTBUG-33093 qtbase-opensource-src-5.4.1/src/gui/kernel/qshortcutmap_p.h
--- qtbase-opensource-src-5.4.1/src/gui/kernel/qshortcutmap_p.h.QTBUG-33093 2015-02-16 22:56:48.000000000 -0600
+++ qtbase-opensource-src-5.4.1/src/gui/kernel/qshortcutmap_p.h 2015-05-06 14:27:40.637978022 -0500
@@ -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<const QShortcutEntry *> matches() const;
- void createNewSequences(QKeyEvent *e, QVector<QKeySequence> &ksl);
+ void createNewSequences(QKeyEvent *e, QVector<QKeySequence> &ksl, int ignoredModifiers);
void clearSequence(QVector<QKeySequence> &ksl);
int translateModifiers(Qt::KeyboardModifiers modifiers);