diff options
Diffstat (limited to 'src/testlib/qtestsystem.h')
-rw-r--r-- | src/testlib/qtestsystem.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/testlib/qtestsystem.h b/src/testlib/qtestsystem.h index bdcc826..540b18d 100644 --- a/src/testlib/qtestsystem.h +++ b/src/testlib/qtestsystem.h @@ -52,6 +52,11 @@ QT_BEGIN_NAMESPACE QT_MODULE(Test) +class QWidget; +#ifdef Q_WS_X11 +extern void qt_x11_wait_for_window_manager(QWidget *w); +#endif + namespace QTest { inline static void qWait(int ms) @@ -65,6 +70,19 @@ namespace QTest QTest::qSleep(10); } while (timer.elapsed() < ms); } + + inline static bool qWaitForWindowShown(QWidget *window) + { +#if defined(Q_WS_X11) + qt_x11_wait_for_window_manager(window); +#elif defined(Q_WS_QWS) + qWait(100); +#else + qWait(50); +#endif + return true; + } + } QT_END_NAMESPACE |