diff options
author | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2009-08-04 13:59:25 (GMT) |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@nokia.com> | 2009-08-05 08:03:46 (GMT) |
commit | decc287134139c61da5610afc060a6ca8d09f368 (patch) | |
tree | 0e4119380fac7c55fd30f91031a8767e0de0af06 /tests/auto | |
parent | 7e8e53cded4622ac35ff115e26e074de6722d1a0 (diff) | |
download | Qt-decc287134139c61da5610afc060a6ca8d09f368.zip Qt-decc287134139c61da5610afc060a6ca8d09f368.tar.gz Qt-decc287134139c61da5610afc060a6ca8d09f368.tar.bz2 |
Cocoa: Menus show old selected values.
We never told Cocoa that it needed to redraw the window view
when a window was shown. This is implicit if the window is
shown for the first time, but needs to be done explicit
if you hide and show it again.
Task-number: 254672
Reviewed-by: bnilsen
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qwidget_window/tst_qwidget_window.cpp | 24 |
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" |