Adapt to QKeySequence changes in Qt6
This commit is contained in:
parent
52035f43b9
commit
5eef3cde22
1 changed files with 8 additions and 0 deletions
|
@ -833,12 +833,20 @@ void ShortcutDialog::accept()
|
|||
{
|
||||
QKeySequence seq = shortcut();
|
||||
if (!seq.isEmpty()) {
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
if (seq[0] == Qt::Key_Escape) {
|
||||
#else
|
||||
if (seq[0] == QKeyCombination(Qt::Key_Escape)) {
|
||||
#endif
|
||||
reject();
|
||||
return;
|
||||
}
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
if (seq[0] == Qt::Key_Space
|
||||
|| (seq[0] & Qt::KeyboardModifierMask) == 0) {
|
||||
#else
|
||||
if (seq[0] == QKeyCombination(Qt::Key_Space) || seq[0].keyboardModifiers() == Qt::NoModifier) {
|
||||
#endif
|
||||
// clear
|
||||
m_ui.keySequenceEdit->clear();
|
||||
QDialog::accept();
|
||||
|
|
Loading…
Reference in a new issue