summaryrefslogtreecommitdiffstats
path: root/src/widgets/dialogs/qmessagebox.cpp
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@qt.io>2018-08-21 02:32:49 +0200
committerOswald Buddenhagen <oswald.buddenhagen@qt.io>2018-08-21 02:32:50 +0200
commit5a03b75c50b2e34552c7ec3e1e15e7b2a0128bf7 (patch)
tree88e05cd6150e0b3cda4e8716668082c655007fb8 /src/widgets/dialogs/qmessagebox.cpp
parent0e7724079f1eae283714ae12769d1372b8f85659 (diff)
parent6553921dd537e416da2f4d1441ab6d63059cda60 (diff)
Merge dev into 5.12
Diffstat (limited to 'src/widgets/dialogs/qmessagebox.cpp')
-rw-r--r--src/widgets/dialogs/qmessagebox.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp
index 52ca88891e..6de952a1d3 100644
--- a/src/widgets/dialogs/qmessagebox.cpp
+++ b/src/widgets/dialogs/qmessagebox.cpp
@@ -1022,6 +1022,16 @@ void QMessageBoxPrivate::detectEscapeButton()
return;
}
+ // If there are two buttons and one of them is the "Show Details..."
+ // button, then make the other one the escape button
+ if (buttons.count() == 2 && detailsButton) {
+ auto idx = buttons.indexOf(detailsButton);
+ if (idx != -1) {
+ detectedEscapeButton = buttons.at(1 - idx);
+ return;
+ }
+ }
+
// if the message box has one RejectRole button, make it the escape button
for (auto *button : buttons) {
if (buttonBox->buttonRole(button) == QDialogButtonBox::RejectRole) {