summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/gui/kernel')
-rw-r--r--tests/auto/gui/kernel/kernel.pro2
-rw-r--r--tests/auto/gui/kernel/noqteventloop/noqteventloop.pro2
-rw-r--r--tests/auto/gui/kernel/qclipboard/copier/main.cpp2
-rw-r--r--tests/auto/gui/kernel/qclipboard/paster/main.cpp4
-rw-r--r--tests/auto/gui/kernel/qclipboard/test/test.pro4
-rw-r--r--tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp4
-rw-r--r--tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp18
-rw-r--r--tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp12
-rw-r--r--tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp16
-rw-r--r--tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp4
-rw-r--r--tests/auto/gui/kernel/qmouseevent/tst_qmouseevent.cpp21
-rw-r--r--tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp56
-rw-r--r--tests/auto/gui/kernel/qwindow/BLACKLIST4
-rw-r--r--tests/auto/gui/kernel/qwindow/qwindow.pro2
-rw-r--r--tests/auto/gui/kernel/qwindow/tst_qwindow.cpp9
15 files changed, 86 insertions, 74 deletions
diff --git a/tests/auto/gui/kernel/kernel.pro b/tests/auto/gui/kernel/kernel.pro
index 5000e1a926..317d8c1ff9 100644
--- a/tests/auto/gui/kernel/kernel.pro
+++ b/tests/auto/gui/kernel/kernel.pro
@@ -25,7 +25,7 @@ SUBDIRS=\
qopenglwindow \
qrasterwindow
-win32:!wince:!winrt:qtHaveModule(network): SUBDIRS += noqteventloop
+win32:!winrt:qtHaveModule(network): SUBDIRS += noqteventloop
!qtHaveModule(widgets): SUBDIRS -= \
qmouseevent_modal \
diff --git a/tests/auto/gui/kernel/noqteventloop/noqteventloop.pro b/tests/auto/gui/kernel/noqteventloop/noqteventloop.pro
index a42b359f29..5e4875d1e7 100644
--- a/tests/auto/gui/kernel/noqteventloop/noqteventloop.pro
+++ b/tests/auto/gui/kernel/noqteventloop/noqteventloop.pro
@@ -5,4 +5,4 @@ QT += core-private network gui-private testlib
SOURCES += tst_noqteventloop.cpp
-contains(QT_CONFIG,dynamicgl):win32:!wince*:!winrt: LIBS += -luser32
+contains(QT_CONFIG,dynamicgl):win32:!winrt: LIBS += -luser32
diff --git a/tests/auto/gui/kernel/qclipboard/copier/main.cpp b/tests/auto/gui/kernel/qclipboard/copier/main.cpp
index 22f2aa3bb8..32e91a9939 100644
--- a/tests/auto/gui/kernel/qclipboard/copier/main.cpp
+++ b/tests/auto/gui/kernel/qclipboard/copier/main.cpp
@@ -33,11 +33,9 @@ int main(int argc, char **argv)
{
QGuiApplication app(argc, argv);
QString paste = QStringLiteral("testString.!");
-#ifndef Q_OS_WINCE
const QStringList arguments = app.arguments();
if (arguments.size() > 1)
paste = arguments.at(1);
-#endif
#ifndef QT_NO_CLIPBOARD
QGuiApplication::clipboard()->setText(paste);
#endif
diff --git a/tests/auto/gui/kernel/qclipboard/paster/main.cpp b/tests/auto/gui/kernel/qclipboard/paster/main.cpp
index c96d903fb7..7fca8af1cb 100644
--- a/tests/auto/gui/kernel/qclipboard/paster/main.cpp
+++ b/tests/auto/gui/kernel/qclipboard/paster/main.cpp
@@ -66,13 +66,9 @@ int main(int argc, char **argv)
return 0;
}
-#ifndef Q_OS_WINCE
QString expected;
if (parser.isSet(textOption))
expected = parser.value(textOption);
-#else // !Q_OS_WINCE
- const QString expected = QStringLiteral("testString.!");
-#endif // Q_OS_WINCE
if (!expected.isEmpty()) {
#ifndef QT_NO_CLIPBOARD
const QString actual = QGuiApplication::clipboard()->text();
diff --git a/tests/auto/gui/kernel/qclipboard/test/test.pro b/tests/auto/gui/kernel/qclipboard/test/test.pro
index 40bf9c8d8e..59b77b11ba 100644
--- a/tests/auto/gui/kernel/qclipboard/test/test.pro
+++ b/tests/auto/gui/kernel/qclipboard/test/test.pro
@@ -13,10 +13,6 @@ win32 {
}
}
-wince* {
- DEPLOYMENT += rsc reg_resource
-}
-
!winrt: TEST_HELPER_INSTALLS = \
../copier/copier \
../paster/paster
diff --git a/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp b/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp
index 6bad45fefe..bfa15744c2 100644
--- a/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp
+++ b/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp
@@ -313,10 +313,6 @@ void tst_QClipboard::setMimeData()
QMimeData *mimeData = new QMimeData;
const QString TestName(QLatin1String("tst_QClipboard::setMimeData() mimeData"));
mimeData->setObjectName(TestName);
-#if defined(Q_OS_WINCE)
- // need to set text on CE
- mimeData->setText(QLatin1String("Qt/CE foo"));
-#endif
QGuiApplication::clipboard()->setMimeData(mimeData);
QCOMPARE(QGuiApplication::clipboard()->mimeData(), (const QMimeData *)mimeData);
diff --git a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp
index 32d0aa504c..f8bcb14ab3 100644
--- a/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp
+++ b/tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp
@@ -106,11 +106,29 @@ void tst_QGuiApplication::displayName()
int argc = 1;
char *argv[] = { const_cast<char*>("tst_qguiapplication") };
QGuiApplication app(argc, argv);
+ QSignalSpy spy(&app, &QGuiApplication::applicationDisplayNameChanged);
+
QCOMPARE(::qAppName(), QString::fromLatin1("tst_qguiapplication"));
QCOMPARE(QGuiApplication::applicationName(), QString::fromLatin1("tst_qguiapplication"));
QCOMPARE(QGuiApplication::applicationDisplayName(), QString::fromLatin1("tst_qguiapplication"));
+
+ QGuiApplication::setApplicationName("The Core Application");
+ QCOMPARE(QGuiApplication::applicationName(), QString::fromLatin1("The Core Application"));
+ QCOMPARE(QGuiApplication::applicationDisplayName(), QString::fromLatin1("The Core Application"));
+ QCOMPARE(spy.count(), 1);
+
QGuiApplication::setApplicationDisplayName("The GUI Application");
QCOMPARE(QGuiApplication::applicationDisplayName(), QString::fromLatin1("The GUI Application"));
+ QCOMPARE(spy.count(), 2);
+
+ QGuiApplication::setApplicationName("The Core Application 2");
+ QCOMPARE(QGuiApplication::applicationName(), QString::fromLatin1("The Core Application 2"));
+ QCOMPARE(QGuiApplication::applicationDisplayName(), QString::fromLatin1("The GUI Application"));
+ QCOMPARE(spy.count(), 2);
+
+ QGuiApplication::setApplicationDisplayName("The GUI Application 2");
+ QCOMPARE(QGuiApplication::applicationDisplayName(), QString::fromLatin1("The GUI Application 2"));
+ QCOMPARE(spy.count(), 3);
}
void tst_QGuiApplication::desktopFileName()
diff --git a/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp b/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp
index 8002303723..cca0e95c29 100644
--- a/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp
+++ b/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp
@@ -31,8 +31,6 @@
#include <QtGui>
#include <QtTest/QtTest>
-#include "../../../qtest-config.h"
-
Q_DECLARE_METATYPE(QMetaType::Type)
class tst_QGuiMetaType: public QObject
@@ -75,14 +73,14 @@ private slots:
F(QVector4D, QVector4D) \
F(QQuaternion, QQuaternion)
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
# define FOR_EACH_GUI_METATYPE(F) \
FOR_EACH_GUI_METATYPE_BASE(F) \
F(QCursor, QCursor)
-#else // !QTEST_NO_CURSOR
+#else // !QT_NO_CURSOR
# define FOR_EACH_GUI_METATYPE(F) \
FOR_EACH_GUI_METATYPE_BASE(F)
-#endif // !QTEST_NO_CURSOR
+#endif // !QT_NO_CURSOR
namespace {
@@ -131,7 +129,7 @@ template<> struct TypeComparator<QMetaType::QBitmap>
{ return v1.size() == v2.size(); }
};
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
template<> struct TypeComparator<QMetaType::QCursor>
{
static bool equal(const QCursor &v1, const QCursor &v2)
@@ -176,7 +174,7 @@ template<> struct TestValueFactory<QMetaType::QRegion> {
template<> struct TestValueFactory<QMetaType::QBitmap> {
static QBitmap *create() { return new QBitmap(16, 32); }
};
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
template<> struct TestValueFactory<QMetaType::QCursor> {
static QCursor *create() { return new QCursor(Qt::WaitCursor); }
};
diff --git a/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp b/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp
index 8be7227c54..a057ec2207 100644
--- a/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp
+++ b/tests/auto/gui/kernel/qguivariant/test/tst_qguivariant.cpp
@@ -52,8 +52,6 @@
#include "tst_qvariant_common.h"
-#include "../../../../qtest-config.h"
-
class tst_QGuiVariant : public QObject
{
Q_OBJECT
@@ -172,7 +170,7 @@ void tst_QGuiVariant::canConvert_data()
var = QVariant::fromValue(QColor());
QTest::newRow("Color")
<< var << N << N << N << Y << Y << Y << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << Y << N << N << N << N;
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
var = QVariant::fromValue(QCursor());
QTest::newRow("Cursor")
<< var << N << N << N << N << N << N << Y << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N;
@@ -508,7 +506,7 @@ void tst_QGuiVariant::writeToReadFromDataStream_data()
QTest::newRow( "bitmap_valid" ) << QVariant::fromValue( bitmap ) << false;
QTest::newRow( "brush_valid" ) << QVariant::fromValue( QBrush( Qt::red ) ) << false;
QTest::newRow( "color_valid" ) << QVariant::fromValue( QColor( Qt::red ) ) << false;
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
QTest::newRow( "cursor_valid" ) << QVariant::fromValue( QCursor( Qt::PointingHandCursor ) ) << false;
#endif
QTest::newRow( "font_valid" ) << QVariant::fromValue( QFont( "times", 12 ) ) << false;
@@ -716,14 +714,14 @@ void tst_QGuiVariant::implicitConstruction()
F(Quaternion) \
F(PolygonF)
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
# define FOR_EACH_GUI_CLASS(F) \
FOR_EACH_GUI_CLASS_BASE(F) \
F(Cursor)
-#else // !QTEST_NO_CURSOR
+#else // !QT_NO_CURSOR
# define FOR_EACH_GUI_CLASS(F) \
FOR_EACH_GUI_CLASS_BASE(F)
-#endif // QTEST_NO_CURSOR
+#endif // QT_NO_CURSOR
#define CONSTRUCT(TYPE) \
{ \
@@ -741,14 +739,14 @@ void tst_QGuiVariant::implicitConstruction()
void tst_QGuiVariant::guiVariantAtExit()
{
// crash test, it should not crash at QGuiApplication exit
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
static QVariant cursor = QCursor();
#endif
static QVariant point = QPoint();
static QVariant icon = QIcon();
static QVariant image = QImage();
static QVariant palette = QPalette();
-#ifndef QTEST_NO_CURSOR
+#ifndef QT_NO_CURSOR
Q_UNUSED(cursor);
#endif
Q_UNUSED(point);
diff --git a/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp b/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp
index 0d0b6ae81e..6394a956bd 100644
--- a/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp
+++ b/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp
@@ -725,7 +725,7 @@ void tst_QKeySequence::listFromString()
void tst_QKeySequence::translated_data()
{
-#if defined (Q_OS_MAC) || defined (Q_OS_WINCE)
+#if defined (Q_OS_DARWIN)
QSKIP("Test not applicable");
#endif
@@ -756,7 +756,7 @@ void tst_QKeySequence::translated_data()
void tst_QKeySequence::translated()
{
-#if !defined (Q_OS_MAC) && !defined (Q_OS_WINCE)
+#if !defined (Q_OS_DARWIN)
QFETCH(QString, transKey);
QFETCH(QString, compKey);
diff --git a/tests/auto/gui/kernel/qmouseevent/tst_qmouseevent.cpp b/tests/auto/gui/kernel/qmouseevent/tst_qmouseevent.cpp
index 6af6738bdb..a1de205571 100644
--- a/tests/auto/gui/kernel/qmouseevent/tst_qmouseevent.cpp
+++ b/tests/auto/gui/kernel/qmouseevent/tst_qmouseevent.cpp
@@ -75,6 +75,7 @@ public slots:
void cleanupTestCase();
void init();
private slots:
+ void mouseEventBasic();
void checkMousePressEvent_data();
void checkMousePressEvent();
void checkMouseReleaseEvent_data();
@@ -107,6 +108,26 @@ void tst_QMouseEvent::init()
testMouseWidget->mouseReleaseModifiers = 0;
}
+void tst_QMouseEvent::mouseEventBasic()
+{
+ QPointF local(100, 100);
+ QPointF scene(200, 200);
+ QPointF screen(300, 300);
+ QMouseEvent me(QEvent::MouseButtonPress, local, scene, screen, Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
+ QCOMPARE(me.isAccepted(), true);
+ QCOMPARE(me.button(), Qt::LeftButton);
+ QCOMPARE(me.buttons(), Qt::LeftButton);
+ QCOMPARE(me.localPos(), local);
+ QCOMPARE(me.windowPos(), scene);
+ QCOMPARE(me.screenPos(), screen);
+
+ QPointF changedLocal(33, 66);
+ me.setLocalPos(changedLocal);
+ QCOMPARE(me.localPos(), changedLocal);
+ QCOMPARE(me.windowPos(), scene);
+ QCOMPARE(me.screenPos(), screen);
+}
+
void tst_QMouseEvent::checkMousePressEvent_data()
{
QTest::addColumn<int>("buttonPressed");
diff --git a/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp b/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp
index 74fd64bf59..e6fd67e3a8 100644
--- a/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp
+++ b/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp
@@ -213,11 +213,10 @@ private:
QTouchDevice *touchPadDevice;
};
-tst_QTouchEvent::tst_QTouchEvent() : touchScreenDevice(new QTouchDevice), touchPadDevice(new QTouchDevice)
+tst_QTouchEvent::tst_QTouchEvent()
+ : touchScreenDevice(QTest::createTouchDevice())
+ , touchPadDevice(QTest::createTouchDevice(QTouchDevice::TouchPad))
{
- touchPadDevice->setType(QTouchDevice::TouchPad);
- QWindowSystemInterface::registerTouchDevice(touchScreenDevice);
- QWindowSystemInterface::registerTouchDevice(touchPadDevice);
}
void tst_QTouchEvent::cleanup()
@@ -1490,10 +1489,6 @@ bool WindowTouchEventFilter::eventFilter(QObject *, QEvent *event)
void tst_QTouchEvent::testQGuiAppDelivery()
{
- QTouchDevice *device = new QTouchDevice;
- device->setType(QTouchDevice::TouchScreen);
- QWindowSystemInterface::registerTouchDevice(device);
-
QWindow w;
w.setGeometry(100, 100, 100, 100);
w.show();
@@ -1521,38 +1516,33 @@ void tst_QTouchEvent::testQGuiAppDelivery()
QCOMPARE(filter.d.isEmpty(), true);
// Now the real thing.
- QWindowSystemInterface::handleTouchEvent(&w, device, points); // TouchBegin
+ QWindowSystemInterface::handleTouchEvent(&w, touchScreenDevice, points); // TouchBegin
QCoreApplication::processEvents();
QCOMPARE(filter.d.count(), 1);
- QCOMPARE(filter.d.contains(device), true);
- QCOMPARE(filter.d.value(device).points.count(), 1);
- QCOMPARE(filter.d.value(device).lastSeenType, QEvent::TouchBegin);
+ QCOMPARE(filter.d.contains(touchScreenDevice), true);
+ QCOMPARE(filter.d.value(touchScreenDevice).points.count(), 1);
+ QCOMPARE(filter.d.value(touchScreenDevice).lastSeenType, QEvent::TouchBegin);
points[0].state = Qt::TouchPointMoved;
- QWindowSystemInterface::handleTouchEvent(&w, device, points); // TouchUpdate
+ QWindowSystemInterface::handleTouchEvent(&w, touchScreenDevice, points); // TouchUpdate
QCoreApplication::processEvents();
QCOMPARE(filter.d.count(), 1);
- QCOMPARE(filter.d.contains(device), true);
- QCOMPARE(filter.d.value(device).points.count(), 2);
- QCOMPARE(filter.d.value(device).lastSeenType, QEvent::TouchUpdate);
+ QCOMPARE(filter.d.contains(touchScreenDevice), true);
+ QCOMPARE(filter.d.value(touchScreenDevice).points.count(), 2);
+ QCOMPARE(filter.d.value(touchScreenDevice).lastSeenType, QEvent::TouchUpdate);
points[0].state = Qt::TouchPointReleased;
- QWindowSystemInterface::handleTouchEvent(&w, device, points); // TouchEnd
+ QWindowSystemInterface::handleTouchEvent(&w, touchScreenDevice, points); // TouchEnd
QCoreApplication::processEvents();
QCOMPARE(filter.d.count(), 1);
- QCOMPARE(filter.d.contains(device), true);
- QCOMPARE(filter.d.value(device).points.count(), 3);
- QCOMPARE(filter.d.value(device).lastSeenType, QEvent::TouchEnd);
+ QCOMPARE(filter.d.contains(touchScreenDevice), true);
+ QCOMPARE(filter.d.value(touchScreenDevice).points.count(), 3);
+ QCOMPARE(filter.d.value(touchScreenDevice).lastSeenType, QEvent::TouchEnd);
}
void tst_QTouchEvent::testMultiDevice()
{
- QTouchDevice *deviceOne = new QTouchDevice;
- deviceOne->setType(QTouchDevice::TouchScreen);
- QWindowSystemInterface::registerTouchDevice(deviceOne);
- QTouchDevice *deviceTwo = new QTouchDevice;
- deviceTwo->setType(QTouchDevice::TouchScreen);
- QWindowSystemInterface::registerTouchDevice(deviceTwo);
+ QTouchDevice *deviceTwo = QTest::createTouchDevice();
QWindow w;
w.setGeometry(100, 100, 100, 100);
@@ -1564,7 +1554,7 @@ void tst_QTouchEvent::testMultiDevice()
QList<QWindowSystemInterface::TouchPoint> pointsOne, pointsTwo;
- // deviceOne reports a single point, deviceTwo reports the beginning of a multi-point sequence.
+ // touchScreenDevice reports a single point, deviceTwo reports the beginning of a multi-point sequence.
// Even though there is a point with id 0 for both devices, they should be delivered cleanly, independently.
QWindowSystemInterface::TouchPoint tp;
tp.id = 0;
@@ -1580,20 +1570,20 @@ void tst_QTouchEvent::testMultiDevice()
tp.area = QHighDpi::toNative(area1, QHighDpiScaling::factor(&w), screenOrigin);
pointsTwo.append(tp);
- QWindowSystemInterface::handleTouchEvent(&w, deviceOne, pointsOne);
+ QWindowSystemInterface::handleTouchEvent(&w, touchScreenDevice, pointsOne);
QWindowSystemInterface::handleTouchEvent(&w, deviceTwo, pointsTwo);
QCoreApplication::processEvents();
- QCOMPARE(filter.d.contains(deviceOne), true);
+ QCOMPARE(filter.d.contains(touchScreenDevice), true);
QCOMPARE(filter.d.contains(deviceTwo), true);
- QCOMPARE(filter.d.value(deviceOne).lastSeenType, QEvent::TouchBegin);
+ QCOMPARE(filter.d.value(touchScreenDevice).lastSeenType, QEvent::TouchBegin);
QCOMPARE(filter.d.value(deviceTwo).lastSeenType, QEvent::TouchBegin);
- QCOMPARE(filter.d.value(deviceOne).points.count(), 1);
+ QCOMPARE(filter.d.value(touchScreenDevice).points.count(), 1);
QCOMPARE(filter.d.value(deviceTwo).points.count(), 2);
- QCOMPARE(filter.d.value(deviceOne).points.at(0).screenRect(), QRectF(area0));
- QCOMPARE(filter.d.value(deviceOne).points.at(0).state(), pointsOne[0].state);
+ QCOMPARE(filter.d.value(touchScreenDevice).points.at(0).screenRect(), QRectF(area0));
+ QCOMPARE(filter.d.value(touchScreenDevice).points.at(0).state(), pointsOne[0].state);
QCOMPARE(filter.d.value(deviceTwo).points.at(0).screenRect(), QRectF(area0));
QCOMPARE(filter.d.value(deviceTwo).points.at(0).state(), pointsTwo[0].state);
diff --git a/tests/auto/gui/kernel/qwindow/BLACKLIST b/tests/auto/gui/kernel/qwindow/BLACKLIST
index 0fe40e8db3..81ab693ee7 100644
--- a/tests/auto/gui/kernel/qwindow/BLACKLIST
+++ b/tests/auto/gui/kernel/qwindow/BLACKLIST
@@ -1,12 +1,16 @@
[positioning:default]
ubuntu-14.04
+ubuntu-16.04
[modalWindowPosition]
ubuntu-14.04
+ubuntu-16.04
[modalWithChildWindow]
ubuntu-14.04
+ubuntu-16.04
[setVisible]
ubuntu-14.04
[modalWindowEnterEventOnHide_QTBUG35109]
ubuntu-14.04
+ubuntu-16.04
[modalDialogClosingOneOfTwoModal]
osx
diff --git a/tests/auto/gui/kernel/qwindow/qwindow.pro b/tests/auto/gui/kernel/qwindow/qwindow.pro
index 08e1b1d3a0..f975e00ffa 100644
--- a/tests/auto/gui/kernel/qwindow/qwindow.pro
+++ b/tests/auto/gui/kernel/qwindow/qwindow.pro
@@ -5,4 +5,4 @@ QT += core-private gui-private testlib
SOURCES += tst_qwindow.cpp
-contains(QT_CONFIG,dynamicgl):win32:!wince:!winrt: LIBS += -luser32
+contains(QT_CONFIG,dynamicgl):win32:!winrt: LIBS += -luser32
diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
index 70446e803a..a41c574454 100644
--- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
+++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
@@ -40,7 +40,7 @@
#if defined(Q_OS_QNX)
#include <QOpenGLContext>
-#elif defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
+#elif defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
# include <QtCore/qt_windows.h>
#endif
@@ -106,7 +106,7 @@ private slots:
private:
QPoint m_availableTopLeft;
QSize m_testWindowSize;
- QTouchDevice *touchDevice;
+ QTouchDevice *touchDevice = QTest::createTouchDevice();
};
void tst_QWindow::initTestCase()
@@ -120,9 +120,6 @@ void tst_QWindow::initTestCase()
if (screenWidth > 2000)
width = 100 * ((screenWidth + 500) / 1000);
m_testWindowSize = QSize(width, width);
- touchDevice = new QTouchDevice;
- touchDevice->setType(QTouchDevice::TouchScreen);
- QWindowSystemInterface::registerTouchDevice(touchDevice);
}
void tst_QWindow::cleanup()
@@ -2098,7 +2095,7 @@ void tst_QWindow::modalWindowEnterEventOnHide_QTBUG35109()
static bool isNativeWindowVisible(const QWindow *window)
{
-#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
+#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
return IsWindowVisible(reinterpret_cast<HWND>(window->winId()));
#else
Q_UNIMPLEMENTED();