summaryrefslogtreecommitdiff
path: root/src/gui/widgets/qdialogbuttonbox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/qdialogbuttonbox.cpp')
-rw-r--r--src/gui/widgets/qdialogbuttonbox.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gui/widgets/qdialogbuttonbox.cpp b/src/gui/widgets/qdialogbuttonbox.cpp
index 5f17a2bdd0..6fe87b6ac8 100644
--- a/src/gui/widgets/qdialogbuttonbox.cpp
+++ b/src/gui/widgets/qdialogbuttonbox.cpp
@@ -562,6 +562,14 @@ QPushButton *QDialogButtonBoxPrivate::createButton(QDialogButtonBox::StandardBut
} else {
qWarning("QDialogButtonBox::createButton: Invalid ButtonRole, button not added");
}
+
+#ifdef 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
+
return button;
}