@@ -20,7 +20,9 @@
2020#include <QtQml/QQmlEngine>
2121#include <QPointer>
2222#include <private/qquickmousearea_p.h>
23−#include <private/qquickwindow_p.h>
23+#if (QT_VERSION >= QT_VERSION_CHECK(5, 4, 0))
24+ #include <private/qquickwindow_p.h>
25+#endif
2426
2527
2628#include <DirectionalDragArea.h>
@@ -815,7 +817,9 @@ void tst_DirectionalDragArea::sceneDistance()
815817
816818 QTest::touchEvent(m_view, m_device).press(0, touchPoint.toPoint());
817819
820+#if (QT_VERSION >= QT_VERSION_CHECK(5, 4, 0))
818821 QQuickWindowPrivate *wp = QQuickWindowPrivate::get(m_view);
822+#endif
819823 for (int i = 0; i < totalMovementSteps; ++i) {
820824 touchPoint += touchMovement;
821825 passTime(movementTimeStepMs);