diff options
author | Alexander Volkov <a.volkov@rusbitech.ru> | 2016-11-09 17:33:00 +0300 |
---|---|---|
committer | Alexander Volkov <a.volkov@rusbitech.ru> | 2016-12-19 11:02:01 +0000 |
commit | de63bbd2f806b0219a60775017899cedb121581f (patch) | |
tree | 9396c1d51fa31ffcb9e02df22bc40430c1295663 /src/widgets/widgets/qdialogbuttonbox.cpp | |
parent | 2f103bde11e2f63b1f079101806754f04d067716 (diff) |
Add QPlatformTheme::standardButtonShortcut()
It allows to set shortcuts for the standard buttons in
QDialogButtonBox.
Restore Qt4's behavior for the "Don't Save" button on macOS
by setting a shortcut for it (it was Cmd-D before Lion,
now it's Cmd-Delete).
Change-Id: I6b56f68f37670962178693a8983d9fe550540856
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/widgets/widgets/qdialogbuttonbox.cpp')
-rw-r--r-- | src/widgets/widgets/qdialogbuttonbox.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/widgets/widgets/qdialogbuttonbox.cpp b/src/widgets/widgets/qdialogbuttonbox.cpp index 23158cf82f..61ef8e8c93 100644 --- a/src/widgets/widgets/qdialogbuttonbox.cpp +++ b/src/widgets/widgets/qdialogbuttonbox.cpp @@ -411,12 +411,7 @@ QPushButton *QDialogButtonBoxPrivate::createButton(QDialogButtonBox::StandardBut else addButton(button, static_cast<QDialogButtonBox::ButtonRole>(role), doLayout); -#if 0 // Used to be included in Qt4 for Q_WS_MAC - // Since mnemonics is off by default on Mac, we add a Cmd-D - // shortcut here to e.g. make the "Don't Save" button work nativly: - if (sbutton == QDialogButtonBox::Discard) - button->setShortcut(QKeySequence(QLatin1String("Ctrl+D"))); -#endif + button->setShortcut(QGuiApplicationPrivate::platformTheme()->standardButtonShortcut(sbutton)); return button; } |