diff --git a/src/gui/kernel/qkeysequence.h b/src/gui/kernel/qkeysequence.h index 44fd1f9cca..a8638fd9d1 100644 --- a/src/gui/kernel/qkeysequence.h +++ b/src/gui/kernel/qkeysequence.h @@ -115,6 +115,7 @@ public: NativeText, PortableText }; + Q_ENUM(SequenceFormat) QKeySequence(); QKeySequence(const QString &key, SequenceFormat format = NativeText); @@ -135,6 +136,7 @@ public: PartialMatch, ExactMatch }; + Q_ENUM(SequenceMatch); QString toString(SequenceFormat format = PortableText) const; static QKeySequence fromString(const QString &str, SequenceFormat format = PortableText); diff --git a/src/gui/kernel/qshortcutmap.cpp b/src/gui/kernel/qshortcutmap.cpp index 1849419372..6e2072b60f 100644 --- a/src/gui/kernel/qshortcutmap.cpp +++ b/src/gui/kernel/qshortcutmap.cpp @@ -392,7 +392,7 @@ QKeySequence::SequenceMatch QShortcutMap::find(QKeyEvent *e, int ignoredModifier return QKeySequence::NoMatch; createNewSequences(e, d->newEntries, ignoredModifiers); - qCDebug(lcShortcutMap) << "Possible shortcut key sequences:" << d->newEntries; + qCDebug(lcShortcutMap) << "Possible input sequences:" << d->newEntries; // Should never happen if (d->newEntries == d->currentSequences) { @@ -407,15 +407,15 @@ QKeySequence::SequenceMatch QShortcutMap::find(QKeyEvent *e, int ignoredModifier bool partialFound = false; bool identicalDisabledFound = false; QList okEntries; - int result = QKeySequence::NoMatch; + QKeySequence::SequenceMatch result = QKeySequence::NoMatch; for (int i = d->newEntries.size()-1; i >= 0 ; --i) { QShortcutEntry entry(d->newEntries.at(i)); // needed for searching qCDebug(lcShortcutMap) << "- checking entry" << entry.id << entry.keyseq; const auto itEnd = d->sequences.constEnd(); auto it = std::lower_bound(d->sequences.constBegin(), itEnd, entry); - int oneKSResult = QKeySequence::NoMatch; - int tempRes = QKeySequence::NoMatch; + QKeySequence::SequenceMatch oneKSResult = QKeySequence::NoMatch; + QKeySequence::SequenceMatch tempRes = QKeySequence::NoMatch; do { if (it == itEnd) break; @@ -469,7 +469,7 @@ QKeySequence::SequenceMatch QShortcutMap::find(QKeyEvent *e, int ignoredModifier if (result != QKeySequence::NoMatch) d->currentSequences = okEntries; qCDebug(lcShortcutMap) << "Returning shortcut match == " << result; - return QKeySequence::SequenceMatch(result); + return result; } /*! \internal