summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2013-09-10 15:21:59 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-12 12:26:44 +0200
commit472f3c17e302d0eb7376f3f8e2716a51e1d0f5cf (patch)
treeffc96672dff64c2079f709ba32b9087c360d852f
parentc0f9aeffc17010547ecdb44900d717f01eb4f1b4 (diff)
standarddialogs example: add detailed text
Demonstrates that you can have mnemonic buttons which don't conflict with the Ctrl-A and Ctrl-C shortcuts. Task-number: QTBUG-6731 Change-Id: I41ce64e6f3bd0cf387af13c5c37894b721b5a3bb Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
-rw-r--r--examples/widgets/dialogs/standarddialogs/dialog.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/examples/widgets/dialogs/standarddialogs/dialog.cpp b/examples/widgets/dialogs/standarddialogs/dialog.cpp
index c626b63b7d..15b1550fac 100644
--- a/examples/widgets/dialogs/standarddialogs/dialog.cpp
+++ b/examples/widgets/dialogs/standarddialogs/dialog.cpp
@@ -47,6 +47,9 @@
"and any number of buttons, each with standard or custom texts." \
"<p>Click a button to close the message box. Pressing the Esc button " \
"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.")
class DialogOptionsWidget : public QGroupBox
@@ -448,6 +451,7 @@ void Dialog::warningMessage()
{
QMessageBox msgBox(QMessageBox::Warning, tr("QMessageBox::warning()"),
MESSAGE, 0, this);
+ msgBox.setDetailedText(MESSAGE_DETAILS);
msgBox.addButton(tr("Save &Again"), QMessageBox::AcceptRole);
msgBox.addButton(tr("&Continue"), QMessageBox::RejectRole);
if (msgBox.exec() == QMessageBox::AcceptRole)