summaryrefslogtreecommitdiffstats
path: root/tests/auto/qwidget_window/tst_qwidget_window.cpp
diff options
context:
space:
mode:
authorJason Barron <jbarron@trolltech.com>2009-08-10 06:56:35 (GMT)
committerJason Barron <jbarron@trolltech.com>2009-08-10 06:56:35 (GMT)
commitf61ec84fc296c6f70011e30788ee511d6b6a18c6 (patch)
tree54b3b81ac83570e65dc9b44b6756005f6ba1efde /tests/auto/qwidget_window/tst_qwidget_window.cpp
parentcc0a411e5e874aa224c26298a109973cb15ea291 (diff)
parentd13418effc5f00474541ae513a30c9a42c2a1cb3 (diff)
downloadQt-f61ec84fc296c6f70011e30788ee511d6b6a18c6.zip
Qt-f61ec84fc296c6f70011e30788ee511d6b6a18c6.tar.gz
Qt-f61ec84fc296c6f70011e30788ee511d6b6a18c6.tar.bz2
Merge commit 'qt/master-stable'
Conflicts: src/corelib/kernel/qobject.cpp src/corelib/tools/qsharedpointer_impl.h src/gui/widgets/qdatetimeedit.cpp src/gui/widgets/qlinecontrol.cpp src/gui/widgets/qlineedit.cpp tests/auto/qcssparser/qcssparser.pro tests/auto/qicoimageformat/tst_qicoimageformat.cpp tests/auto/qmultiscreen/qmultiscreen.pro tests/auto/qresourceengine/qresourceengine.pro tests/auto/qresourceengine/tst_qresourceengine.cpp tests/auto/qscriptv8testsuite/tst_qscriptv8testsuite.cpp
Diffstat (limited to 'tests/auto/qwidget_window/tst_qwidget_window.cpp')
-rw-r--r--tests/auto/qwidget_window/tst_qwidget_window.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/auto/qwidget_window/tst_qwidget_window.cpp b/tests/auto/qwidget_window/tst_qwidget_window.cpp
index f059abe..6dddfe8 100644
--- a/tests/auto/qwidget_window/tst_qwidget_window.cpp
+++ b/tests/auto/qwidget_window/tst_qwidget_window.cpp
@@ -78,6 +78,7 @@ private slots:
void tst_windowFilePath();
void tst_showWithoutActivating();
+ void tst_paintEventOnSecondShow();
};
void tst_QWidget_window::initTestCase()
@@ -150,7 +151,9 @@ class TestWidget : public QWidget
{
public:
int m_first, m_next;
- void reset(){ m_first = m_next = 0; }
+ bool paintEventReceived;
+
+ void reset(){ m_first = m_next = 0; paintEventReceived = false; }
bool event(QEvent *event)
{
switch (event->type()) {
@@ -162,6 +165,10 @@ public:
m_next = event->type();
else
m_first = event->type();
+ break;
+ case QEvent::Paint:
+ paintEventReceived = true;
+ break;
default:
break;
}
@@ -300,5 +307,20 @@ void tst_QWidget_window::tst_showWithoutActivating()
#endif // Q_WS_X11
}
+void tst_QWidget_window::tst_paintEventOnSecondShow()
+{
+ TestWidget w;
+ w.show();
+ w.hide();
+
+ w.reset();
+ w.show();
+#ifdef Q_WS_X11
+ QTest::qWait(500);
+#endif
+ QApplication::processEvents();
+ QVERIFY(w.paintEventReceived);
+}
+
QTEST_MAIN(tst_QWidget_window)
#include "tst_qwidget_window.moc"