summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/dialogs
diff options
context:
space:
mode:
authorAlexander Volkov <a.volkov@rusbitech.ru>2018-07-18 17:51:11 +0300
committerShawn Rutledge <shawn.rutledge@qt.io>2018-08-14 04:39:05 +0000
commit43f5377fad3f462a033d836fd71a6eb356462c11 (patch)
treec74b7efca3809e2294c1c3594bfd6744e9659571 /tests/auto/widgets/dialogs
parentedbac716911e49a6b0f81b328e65756f95cb1f0a (diff)
Make QMessageBox window with the detailed text closable
QMessageBox window ignores QCloseEvent if it was created with Ok button and the detailed text was set. But it can be closed if it contains only one button. Make it closable if there are two buttons and one of them is the "Show Details..." button. [ChangeLog][QtWidgets][QMessageBox] A message box with two buttons, one of which is the "Show Details..." button, can be closed by clicking the X button on the window's title bar. Task-number: QTBUG-69526 Change-Id: Iba09e38561eb3898dc2aecfd38d8519d512a71c1 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'tests/auto/widgets/dialogs')
-rw-r--r--tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp
index a5058f4b6c..70f5c40bcc 100644
--- a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp
+++ b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp
@@ -329,6 +329,12 @@ void tst_QMessageBox::escapeButton()
closeHelper.start(ExecCloseHelper::CloseWindow, &msgBox2);
msgBox2.exec();
QVERIFY(msgBox2.clickedButton() == msgBox2.button(QMessageBox::No)); // auto detected (one No button only)
+
+ QMessageBox msgBox3;
+ msgBox3.setDetailedText("Details");
+ closeHelper.start(ExecCloseHelper::CloseWindow, &msgBox3);
+ msgBox3.exec();
+ QVERIFY(msgBox3.clickedButton() == msgBox3.button(QMessageBox::Ok)); // auto detected
}
void tst_QMessageBox::statics()