Rename Numpad to Num, ensure Numpad is translated in all cases on Mac.
Numpad is unnecessarily long. Change-Id: I19a6ce129e26a4f6f8344f514317214c48abde6e Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: David Faure (KDE) <faure@kde.org>
This commit is contained in:
parent
7ebf21e004
commit
9a7bc0fc1b
@ -1226,7 +1226,7 @@ int QKeySequencePrivate::decodeString(const QString &str, QKeySequence::Sequence
|
||||
<< QModifKeyName(Qt::SHIFT, QLatin1String("shift+"))
|
||||
<< QModifKeyName(Qt::ALT, QLatin1String("alt+"))
|
||||
<< QModifKeyName(Qt::META, QLatin1String("meta+"))
|
||||
<< QModifKeyName(Qt::KeypadModifier, QLatin1String("numpad+"));
|
||||
<< QModifKeyName(Qt::KeypadModifier, QLatin1String("num+"));
|
||||
}
|
||||
} else {
|
||||
gmodifs = globalPortableModifs();
|
||||
@ -1235,7 +1235,7 @@ int QKeySequencePrivate::decodeString(const QString &str, QKeySequence::Sequence
|
||||
<< QModifKeyName(Qt::SHIFT, QLatin1String("shift+"))
|
||||
<< QModifKeyName(Qt::ALT, QLatin1String("alt+"))
|
||||
<< QModifKeyName(Qt::META, QLatin1String("meta+"))
|
||||
<< QModifKeyName(Qt::KeypadModifier, QLatin1String("numpad+"));
|
||||
<< QModifKeyName(Qt::KeypadModifier, QLatin1String("num+"));
|
||||
}
|
||||
}
|
||||
if (!gmodifs) return ret;
|
||||
@ -1247,7 +1247,7 @@ int QKeySequencePrivate::decodeString(const QString &str, QKeySequence::Sequence
|
||||
<< QModifKeyName(Qt::SHIFT, QCoreApplication::translate("QShortcut", "Shift").toLower().append(QLatin1Char('+')))
|
||||
<< QModifKeyName(Qt::ALT, QCoreApplication::translate("QShortcut", "Alt").toLower().append(QLatin1Char('+')))
|
||||
<< QModifKeyName(Qt::META, QCoreApplication::translate("QShortcut", "Meta").toLower().append(QLatin1Char('+')))
|
||||
<< QModifKeyName(Qt::KeypadModifier, QCoreApplication::translate("QShortcut", "Numpad").toLower().append(QLatin1Char('+')));
|
||||
<< QModifKeyName(Qt::KeypadModifier, QCoreApplication::translate("QShortcut", "Num").toLower().append(QLatin1Char('+')));
|
||||
}
|
||||
modifs += *gmodifs; // Test non-translated ones last
|
||||
|
||||
@ -1421,9 +1421,9 @@ QString QKeySequencePrivate::encodeString(int key, QKeySequence::SequenceFormat
|
||||
addKey(s, nativeText ? QCoreApplication::translate("QShortcut", "Alt") : QString::fromLatin1("Alt"), format);
|
||||
if ((key & Qt::SHIFT) == Qt::SHIFT)
|
||||
addKey(s, nativeText ? QCoreApplication::translate("QShortcut", "Shift") : QString::fromLatin1("Shift"), format);
|
||||
if ((key & Qt::KeypadModifier) == Qt::KeypadModifier)
|
||||
addKey(s, nativeText ? QCoreApplication::translate("QShortcut", "Numpad") : QString::fromLatin1("Numpad"), format);
|
||||
}
|
||||
if ((key & Qt::KeypadModifier) == Qt::KeypadModifier)
|
||||
addKey(s, nativeText ? QCoreApplication::translate("QShortcut", "Num") : QString::fromLatin1("Num"), format);
|
||||
|
||||
|
||||
key &= ~(Qt::ShiftModifier | Qt::ControlModifier | Qt::AltModifier | Qt::MetaModifier | Qt::KeypadModifier);
|
||||
|
@ -510,11 +510,11 @@ void tst_QKeySequence::toStringFromKeycode_data()
|
||||
QTest::newRow("A") << QKeySequence(Qt::Key_A) << "A";
|
||||
QTest::newRow("-1") << QKeySequence(-1) << "";
|
||||
QTest::newRow("Unknown") << QKeySequence(Qt::Key_unknown) << "";
|
||||
QTest::newRow("Ctrl+Numpad+Ins") << QKeySequence(Qt::ControlModifier | Qt::KeypadModifier | Qt::Key_Insert) << "Ctrl+Numpad+Ins";
|
||||
QTest::newRow("Ctrl+Numpad+Del") << QKeySequence(Qt::ControlModifier | Qt::KeypadModifier | Qt::Key_Delete) << "Ctrl+Numpad+Del";
|
||||
QTest::newRow("Ctrl+Alt+Numpad+Del") << QKeySequence(Qt::ControlModifier | Qt::AltModifier | Qt::KeypadModifier | Qt::Key_Delete) << "Ctrl+Alt+Numpad+Del";
|
||||
QTest::newRow("Ctrl+Num+Ins") << QKeySequence(Qt::ControlModifier | Qt::KeypadModifier | Qt::Key_Insert) << "Ctrl+Num+Ins";
|
||||
QTest::newRow("Ctrl+Num+Del") << QKeySequence(Qt::ControlModifier | Qt::KeypadModifier | Qt::Key_Delete) << "Ctrl+Num+Del";
|
||||
QTest::newRow("Ctrl+Alt+Num+Del") << QKeySequence(Qt::ControlModifier | Qt::AltModifier | Qt::KeypadModifier | Qt::Key_Delete) << "Ctrl+Alt+Num+Del";
|
||||
QTest::newRow("Ctrl+Ins") << QKeySequence(Qt::ControlModifier | Qt::Key_Insert) << "Ctrl+Ins";
|
||||
QTest::newRow("Ctrl+Numpad+Ins(1)") << QKeySequence(Qt::Key_Insert | Qt::KeypadModifier | Qt::ControlModifier) << "Ctrl+Numpad+Ins";
|
||||
QTest::newRow("Ctrl+Num+Ins(1)") << QKeySequence(Qt::Key_Insert | Qt::KeypadModifier | Qt::ControlModifier) << "Ctrl+Num+Ins";
|
||||
}
|
||||
|
||||
void tst_QKeySequence::toStringFromKeycode()
|
||||
|
Loading…
Reference in New Issue
Block a user