summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/widgets/dialogs/standarddialogs/dialog.cpp4
-rw-r--r--src/widgets/dialogs/qmessagebox.cpp8
2 files changed, 8 insertions, 4 deletions
diff --git a/examples/widgets/dialogs/standarddialogs/dialog.cpp b/examples/widgets/dialogs/standarddialogs/dialog.cpp
index 5ce992434a..c9faea03f6 100644
--- a/examples/widgets/dialogs/standarddialogs/dialog.cpp
+++ b/examples/widgets/dialogs/standarddialogs/dialog.cpp
@@ -12,8 +12,8 @@
Dialog::tr("<p>Click a button to close the message box. Pressing the Escape key " \
"will activate the detected escape button (if any).")
#define MESSAGE_DETAILS \
- Dialog::tr("If a message box has detailed text, the user can reveal it " \
- "by pressing the Show Details... button.")
+ Dialog::tr("Additional detailed text can be provided, which may require user " \
+ "action to be revealed.")
class DialogOptionsWidget : public QGroupBox
diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp
index 28bf9b0c03..581bc3f93c 100644
--- a/src/widgets/dialogs/qmessagebox.cpp
+++ b/src/widgets/dialogs/qmessagebox.cpp
@@ -843,8 +843,12 @@ void QMessageBox::addButton(QAbstractButton *button, ButtonRole role)
if (!button)
return;
removeButton(button);
- d->options->addButton(button->text(), static_cast<QPlatformDialogHelper::ButtonRole>(role),
- button);
+ // Add button to native dialog helper, unless it's the details button,
+ // since we don't do any plumbing for the button's action in that case.
+ if (button != d->detailsButton) {
+ d->options->addButton(button->text(),
+ static_cast<QPlatformDialogHelper::ButtonRole>(role), button);
+ }
d->buttonBox->addButton(button, (QDialogButtonBox::ButtonRole)role);
d->customButtonList.append(button);
d->autoAddOkButton = false;