Shortcuts with KeypadModifier not working (QTBUG-33093,#1219173)

This commit is contained in:
Rex Dieter 2015-05-06 14:32:32 -05:00
parent e36caa29b2
commit 7f1b5be863
2 changed files with 74 additions and 1 deletions

View File

@ -37,7 +37,7 @@
Summary: Qt5 - QtBase components
Name: qt5-qtbase
Version: 5.4.1
Release: 13%{?dist}
Release: 14%{?dist}
# See LGPL_EXCEPTIONS.txt, for exception details
License: LGPLv2 with exceptions or GPLv3 with exceptions
@ -90,6 +90,11 @@ Patch50: qt5-poll.patch
# https://bugreports.qt.io/browse/QTBUG-42985
Patch51: qtbase-opensource-src-5.4.0-QTBUG-42985.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1219173
# https://bugreports.qt.io/browse/QTBUG-33093
# https://codereview.qt-project.org/#/c/95219/
Patch52: qtbase-opensource-src-5.4.1-QTBUG-33093.patch
## upstream patches
# workaround https://bugreports.qt-project.org/browse/QTBUG-43057
# 'make docs' crash on el6, use qSort instead of std::sort
@ -364,6 +369,7 @@ rm -fv mkspecs/linux-g++*/qmake.conf.multilib-optflags
#patch50 -p1 -b .poll
%patch51 -p1 -b .QTBUG-42985
%patch52 -p1 -b .QTBUG-33093
%if 0%{?rhel} == 6
%patch100 -p1 -b .QTBUG-43057
@ -899,6 +905,9 @@ fi
%changelog
* Wed May 06 2015 Rex Dieter <rdieter@fedoraproject.org> 5.4.1-14
- Shortcuts with KeypadModifier not working (QTBUG-33093,#1219173)
* Tue May 05 2015 Rex Dieter <rdieter@fedoraproject.org> 5.4.1-13
- backport: data corruption in QNetworkAccessManager

View File

@ -0,0 +1,64 @@
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);