diff options
author | Andrew Knight <andrew.knight@digia.com> | 2013-09-01 19:05:46 +0300 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-02 12:36:05 +0200 |
commit | c6af0a504f2acced8147a1dd78bc249da49d3d99 (patch) | |
tree | 77355f11d9c7d03277b40b000db29a651a5df1d4 /tests/auto/widgets/kernel/qwidget | |
parent | c097670bf8f9c3871ca12bf9a257702f8dc4e947 (diff) |
WinRT: Fix various test compilations
- Remove irrelevant test subdirs via .pro files
- Follow WinCE codepaths where applicable
- Replace unsupported Win32 APIs with WinRT equivalents
This does not aim to fix any failures in the tests themselves; it only
makes them compile.
Change-Id: Ia82bc0cc402891f8f6238d4c261ee9152b51be80
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'tests/auto/widgets/kernel/qwidget')
-rw-r--r-- | tests/auto/widgets/kernel/qwidget/qwidget.pro | 2 | ||||
-rw-r--r-- | tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp | 24 |
2 files changed, 14 insertions, 12 deletions
diff --git a/tests/auto/widgets/kernel/qwidget/qwidget.pro b/tests/auto/widgets/kernel/qwidget/qwidget.pro index a4fcde8a34..3eedfa1d3a 100644 --- a/tests/auto/widgets/kernel/qwidget/qwidget.pro +++ b/tests/auto/widgets/kernel/qwidget/qwidget.pro @@ -20,7 +20,7 @@ x11 { LIBS += $$QMAKE_LIBS_X11 } -!wince*:win32: LIBS += -luser32 -lgdi32 +!wince*:win32:!winrt: LIBS += -luser32 -lgdi32 mac:CONFIG+=insignificant_test # QTBUG-25300, QTBUG-23695 linux-*:system(". /etc/lsb-release && [ $DISTRIB_CODENAME = oneiric ]"):DEFINES+=UBUNTU_ONEIRIC # QTBUG-30566
\ No newline at end of file diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index 227f61b0a3..2da8df6116 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -116,11 +116,13 @@ static bool qt_wince_is_platform(const QString &platformString) { } static inline bool qt_wince_is_smartphone() { return qt_wince_is_platform(QString::fromLatin1("Smartphone")); } # endif // Q_OS_WINCE_WM -# else // Q_OS_WINCE +# elif !defined(Q_OS_WINRT) // Q_OS_WINCE # define Q_CHECK_PAINTEVENTS \ if (::SwitchDesktop(::GetThreadDesktop(::GetCurrentThreadId())) == 0) \ QSKIP("desktop is not visible, this test would fail"); -# endif // !Q_OS_WINCE +# else // !Q_OS_WINCE && !Q_OS_WINRT +# define Q_CHECK_PAINTEVENTS +# endif // Q_OS_WINRT #else // Q_OS_WIN # define Q_CHECK_PAINTEVENTS #endif // else Q_OS_WIN @@ -285,7 +287,7 @@ private slots: void subtractOpaqueSiblings(); #endif -#if defined (Q_OS_WIN) && !defined(Q_OS_WINCE) +#if defined (Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) void setGeometry_win(); #endif @@ -355,7 +357,7 @@ private slots: void quitOnCloseAttribute(); void moveRect(); -#if defined (Q_OS_WIN) +#if defined (Q_OS_WIN) && !defined(Q_OS_WINRT) void gdiPainting(); void paintOnScreenPossible(); #endif @@ -572,7 +574,7 @@ void tst_QWidget::getSetCheck() QCOMPARE(true, obj1.autoFillBackground()); var1.reset(); -#if defined (Q_OS_WIN) && !defined(Q_OS_WINCE) +#if defined (Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) obj1.setWindowFlags(Qt::FramelessWindowHint | Qt::WindowSystemMenuHint); const HWND handle = reinterpret_cast<HWND>(obj1.winId()); // explicitly create window handle QVERIFY(GetWindowLong(handle, GWL_STYLE) & WS_POPUP); @@ -1257,7 +1259,7 @@ void tst_QWidget::visible_setWindowOpacity() testWidget->hide(); QVERIFY( !testWidget->isVisible() ); testWidget->setWindowOpacity(0.5); -#ifdef Q_OS_WIN +#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) QVERIFY(!::IsWindowVisible(winHandleOf(testWidget))); #endif testWidget->setWindowOpacity(1.0); @@ -3597,7 +3599,7 @@ void tst_QWidget::optimizedResize_topLevel() topLevel.partial = false; topLevel.paintedRegion = QRegion(); -#ifndef Q_OS_WIN +#if !defined(Q_OS_WIN32) && !defined(Q_OS_WINCE) topLevel.resize(topLevel.size() + QSize(10, 10)); #else // Static contents does not work when programmatically resizing @@ -4529,7 +4531,7 @@ void tst_QWidget::setWindowGeometry() } } -#if defined (Q_OS_WIN) && !defined(Q_OS_WINCE) +#if defined (Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) void tst_QWidget::setGeometry_win() { QWidget widget; @@ -4548,7 +4550,7 @@ void tst_QWidget::setGeometry_win() QEXPECT_FAIL("", "QTBUG-26424", Continue); QVERIFY(rt.top <= 0); } -#endif // defined (Q_OS_WIN) && !defined(Q_OS_WINCE) +#endif // defined (Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT) // Since X11 WindowManager operation are all async, and we have no way to know if the window // manager has finished playing with the window geometry, this test can't be reliable on X11. @@ -8047,7 +8049,7 @@ void tst_QWidget::moveRect() child.move(10, 10); // Don't crash. } -#ifdef Q_OS_WIN +#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) class GDIWidget : public QDialog { Q_OBJECT @@ -8114,7 +8116,7 @@ void tst_QWidget::paintOnScreenPossible() w2.setAttribute(Qt::WA_PaintOnScreen); QVERIFY(w2.testAttribute(Qt::WA_PaintOnScreen)); } -#endif // Q_OS_WIN +#endif // Q_OS_WIN && !Q_OS_WINRT void tst_QWidget::reparentStaticWidget() { |