diff options
Diffstat (limited to 'tests/auto/other/gestures')
-rw-r--r-- | tests/auto/other/gestures/BLACKLIST | 58 | ||||
-rw-r--r-- | tests/auto/other/gestures/CMakeLists.txt | 6 | ||||
-rw-r--r-- | tests/auto/other/gestures/tst_gestures.cpp | 18 |
3 files changed, 15 insertions, 67 deletions
diff --git a/tests/auto/other/gestures/BLACKLIST b/tests/auto/other/gestures/BLACKLIST index 31c0f377cc..8e96992e4d 100644 --- a/tests/auto/other/gestures/BLACKLIST +++ b/tests/auto/other/gestures/BLACKLIST @@ -1,62 +1,4 @@ [panelPropagation] -ubuntu-20.04 ubuntu-22.04 ci [panelStacksBehindParent] -ubuntu-20.04 ubuntu-22.04 ci - -# QTBUG-108402 -[gestureOverChildGraphicsItem] -macOS arm - -# QTBUG-108402 -[conflictingGesturesInGraphicsView] -macOS arm - -# QTBUG-108402 -[graphicsItemGesture] -macOS arm - -# QTBUG-108402 -[graphicsView] -macOS arm - -# QTBUG-108402 -[graphicsItemTreeGesture] -macOS arm - -# QTBUG-108402 -[explicitGraphicsObjectTarget] -macOS arm - -# QTBUG-108402 -[gestureOverChildGraphicsItem] -macOS arm - -# QTBUG-108402 -[autoCancelGestures2] -macOS arm - -# QTBUG-108402 -[graphicsViewParentPropagation] -macOS arm - -# QTBUG-108402 -[panelPropagation] -macOS arm - -# QTBUG-108402 -[panelStacksBehindParent] -macOS arm - -# QTBUG-108402 -[viewportCoordinates] -macOS arm - -# QTBUG-108402 -[partialGesturePropagation] -macOS arm - -# QTBUG-108402 -[testReuseCanceledGestures] -macOS arm diff --git a/tests/auto/other/gestures/CMakeLists.txt b/tests/auto/other/gestures/CMakeLists.txt index 565ee19438..815846305a 100644 --- a/tests/auto/other/gestures/CMakeLists.txt +++ b/tests/auto/other/gestures/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_gestures Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_gestures LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_gestures SOURCES tst_gestures.cpp diff --git a/tests/auto/other/gestures/tst_gestures.cpp b/tests/auto/other/gestures/tst_gestures.cpp index 4d87ee03df..a413268321 100644 --- a/tests/auto/other/gestures/tst_gestures.cpp +++ b/tests/auto/other/gestures/tst_gestures.cpp @@ -1,6 +1,5 @@ // Copyright (C) 2016 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QTest> #include <QtTest/qtesttouch.h> @@ -209,7 +208,7 @@ protected: QGestureEvent *e = static_cast<QGestureEvent*>(event); ++gestureEventsReceived; eventsPtr = &events; - foreach(Qt::GestureType type, ignoredGestures) + for (Qt::GestureType type : std::as_const(ignoredGestures)) e->ignore(e->gesture(type)); } else if (event->type() == QEvent::GestureOverride) { ++gestureOverrideEventsReceived; @@ -219,8 +218,8 @@ protected: } if (eventsPtr) { QGestureEvent *e = static_cast<QGestureEvent*>(event); - QList<QGesture*> gestures = e->gestures(); - foreach(QGesture *g, gestures) { + const QList<QGesture*> gestures = e->gestures(); + for (QGesture *g : gestures) { eventsPtr->all << g->gestureType(); switch(g->state()) { case Qt::GestureStarted: @@ -743,9 +742,10 @@ public: ++gestureEventsReceived; eventsPtr = &events; QGestureEvent *e = static_cast<QGestureEvent *>(event); - foreach(Qt::GestureType type, ignoredGestures) + for (Qt::GestureType type : std::as_const(ignoredGestures)) e->ignore(e->gesture(type)); - foreach(QGesture *g, e->gestures()) { + const auto gestures = e->gestures(); + for (QGesture *g : gestures) { switch (g->state()) { case Qt::GestureStarted: if (ignoredStartedGestures.contains(g->gestureType())) @@ -771,8 +771,8 @@ public: } if (eventsPtr) { QGestureEvent *e = static_cast<QGestureEvent*>(event); - QList<QGesture*> gestures = e->gestures(); - foreach(QGesture *g, gestures) { + const QList<QGesture*> gestures = e->gestures(); + for (QGesture *g : gestures) { eventsPtr->all << g->gestureType(); switch(g->state()) { case Qt::GestureStarted: |