summaryrefslogtreecommitdiffstats
path: root/src/widgets/dialogs/qmessagebox.cpp
diff options
context:
space:
mode:
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) {