summaryrefslogtreecommitdiffstats
path: root/src/widgets/dialogs
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-09-29 13:09:19 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-11-04 10:32:38 +0200
commitb26fa9722f9e8c81406259f6db8044e8bbc2d50b (patch)
tree30d443ac43663e1670c82621d88052e3be29141b /src/widgets/dialogs
parent8fa93272f0a1526e06105ea02c7ae5ca8f8c52c0 (diff)
Add multi key bindings to QShortcut
This makes it feature comparable with QAction, and makes it possible to use as a backend for QAction, and fixes a few missing alternative keybindings in qtwidgets. Change-Id: Iaefc630b96c4743fc5ef429dc841870ddd99fc64 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/widgets/dialogs')
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp6
-rw-r--r--src/widgets/dialogs/qprogressdialog.cpp1
2 files changed, 2 insertions, 5 deletions
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
index adbf655750..ff884d925e 100644
--- a/src/widgets/dialogs/qfiledialog.cpp
+++ b/src/widgets/dialogs/qfiledialog.cpp
@@ -3048,8 +3048,7 @@ void QFileDialogPrivate::createWidgets()
QObject::connect(qFileDialogUi->listView, SIGNAL(customContextMenuRequested(QPoint)),
q, SLOT(_q_showContextMenu(QPoint)));
#ifndef QT_NO_SHORTCUT
- QShortcut *shortcut = new QShortcut(qFileDialogUi->listView);
- shortcut->setKey(QKeySequence(QLatin1String("Delete")));
+ QShortcut *shortcut = new QShortcut(QKeySequence::Delete, qFileDialogUi->listView);
QObject::connect(shortcut, SIGNAL(activated()), q, SLOT(_q_deleteCurrent()));
#endif
@@ -3088,8 +3087,7 @@ void QFileDialogPrivate::createWidgets()
QObject::connect(qFileDialogUi->treeView, SIGNAL(customContextMenuRequested(QPoint)),
q, SLOT(_q_showContextMenu(QPoint)));
#ifndef QT_NO_SHORTCUT
- shortcut = new QShortcut(qFileDialogUi->treeView);
- shortcut->setKey(QKeySequence(QLatin1String("Delete")));
+ shortcut = new QShortcut(QKeySequence::Delete, qFileDialogUi->treeView);
QObject::connect(shortcut, SIGNAL(activated()), q, SLOT(_q_deleteCurrent()));
#endif
diff --git a/src/widgets/dialogs/qprogressdialog.cpp b/src/widgets/dialogs/qprogressdialog.cpp
index 645ca1013a..32834291b8 100644
--- a/src/widgets/dialogs/qprogressdialog.cpp
+++ b/src/widgets/dialogs/qprogressdialog.cpp
@@ -403,7 +403,6 @@ void QProgressDialog::setCancelButton(QPushButton *cancelButton)
if (cancelButton) {
connect(d->cancel, SIGNAL(clicked()), this, SIGNAL(canceled()));
#ifndef QT_NO_SHORTCUT
- // FIXME: This only registers the primary key sequence of the cancel action
d->escapeShortcut = new QShortcut(QKeySequence::Cancel, this, SIGNAL(canceled()));
#endif
} else {