summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp
diff options
context:
space:
mode:
authorSergio Ahumada <sergio.ahumada@digia.com>2013-09-21 17:34:59 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-21 18:39:13 +0200
commit4cebef621bb108c76f3cc8bfd0fdf77174b6499d (patch)
tree657eceb4539343312e7cd33b3644d1b1ec116ae2 /tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp
parent8969f57b6abef31d2e27500742dffa5498e38a46 (diff)
parenta5d34b34fbd867bd13ce94cdaf55d96576d4d14d (diff)
Merge "Merge branch 'stable' into dev" into refs/staging/dev
Diffstat (limited to 'tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp')
-rw-r--r--tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp
index c3faa93309..0425db3098 100644
--- a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp
+++ b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp
@@ -114,6 +114,7 @@ private slots:
void about();
void detailsText();
void detailsButtonText();
+ void expandDetails_QTBUG_32473();
#ifndef Q_OS_MAC
void shortcut();
@@ -137,6 +138,19 @@ private:
QTimer keySendTimer;
};
+class tst_ResizingMessageBox : public QMessageBox
+{
+public:
+ tst_ResizingMessageBox() : QMessageBox(), resized(false) { }
+ bool resized;
+
+protected:
+ void resizeEvent ( QResizeEvent * event ) {
+ resized = true;
+ QMessageBox::resizeEvent(event);
+ }
+};
+
tst_QMessageBox::tst_QMessageBox() : keyToSend(-1)
{
}
@@ -603,6 +617,37 @@ void tst_QMessageBox::detailsButtonText()
}
}
+void tst_QMessageBox::expandDetails_QTBUG_32473()
+{
+ tst_ResizingMessageBox box;
+ box.setDetailedText("bla");
+ box.show();
+ QApplication::postEvent(&box, new QEvent(QEvent::LanguageChange));
+ QApplication::processEvents();
+ QDialogButtonBox* bb = box.findChild<QDialogButtonBox*>("qt_msgbox_buttonbox");
+ QVERIFY(bb);
+
+ QList<QAbstractButton *> list = bb->buttons();
+ QAbstractButton* moreButton = NULL;
+ foreach (QAbstractButton* btn, list)
+ if (btn && bb->buttonRole(btn) == QDialogButtonBox::ActionRole)
+ moreButton = btn;
+ QVERIFY(moreButton);
+ QVERIFY(QTest::qWaitForWindowExposed(&box));
+ QRect geom = box.geometry();
+ box.resized = false;
+ moreButton->click();
+ QTRY_VERIFY(box.resized);
+ // After we receive the expose event for a second widget, it's likely
+ // that the window manager is also done manipulating the first QMessageBox.
+ QWidget fleece;
+ fleece.show();
+ QTest::qWaitForWindowExposed(&fleece);
+ if (geom.topLeft() == box.geometry().topLeft())
+ QTest::qWait(500);
+ QCOMPARE(geom.topLeft(), box.geometry().topLeft());
+}
+
void tst_QMessageBox::incorrectDefaultButton()
{
keyToSend = Qt::Key_Escape;