summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/kernel/qscreen
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/gui/kernel/qscreen')
-rw-r--r--tests/auto/gui/kernel/qscreen/CMakeLists.txt8
-rw-r--r--tests/auto/gui/kernel/qscreen/tst_qscreen.cpp17
2 files changed, 14 insertions, 11 deletions
diff --git a/tests/auto/gui/kernel/qscreen/CMakeLists.txt b/tests/auto/gui/kernel/qscreen/CMakeLists.txt
index acb4d8a396..8502176ca4 100644
--- a/tests/auto/gui/kernel/qscreen/CMakeLists.txt
+++ b/tests/auto/gui/kernel/qscreen/CMakeLists.txt
@@ -1,12 +1,16 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
-# Generated from qscreen.pro.
-
#####################################################################
## tst_qscreen Test:
#####################################################################
+if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+ cmake_minimum_required(VERSION 3.16)
+ project(tst_qscreen LANGUAGES CXX)
+ find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST)
+endif()
+
qt_internal_add_test(tst_qscreen
SOURCES
tst_qscreen.cpp
diff --git a/tests/auto/gui/kernel/qscreen/tst_qscreen.cpp b/tests/auto/gui/kernel/qscreen/tst_qscreen.cpp
index 9d85a31d5a..74a03ac851 100644
--- a/tests/auto/gui/kernel/qscreen/tst_qscreen.cpp
+++ b/tests/auto/gui/kernel/qscreen/tst_qscreen.cpp
@@ -1,5 +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 <qpainter.h>
#include <qrasterwindow.h>
@@ -158,35 +158,34 @@ void tst_QScreen::orientationChange()
QWindowSystemInterface::handleScreenOrientationChange(screen, Qt::LandscapeOrientation);
QWindowSystemInterface::flushWindowSystemEvents();
QTRY_COMPARE(screen->orientation(), Qt::LandscapeOrientation);
- QCOMPARE(spy.count(), ++expectedSignalCount);
+ QCOMPARE(spy.size(), ++expectedSignalCount);
QWindowSystemInterface::handleScreenOrientationChange(screen, Qt::PortraitOrientation);
QWindowSystemInterface::flushWindowSystemEvents();
QTRY_COMPARE(screen->orientation(), Qt::PortraitOrientation);
- QCOMPARE(spy.count(), ++expectedSignalCount);
+ QCOMPARE(spy.size(), ++expectedSignalCount);
QWindowSystemInterface::handleScreenOrientationChange(screen, Qt::InvertedLandscapeOrientation);
QWindowSystemInterface::flushWindowSystemEvents();
QTRY_COMPARE(screen->orientation(), Qt::InvertedLandscapeOrientation);
- QCOMPARE(spy.count(), ++expectedSignalCount);
+ QCOMPARE(spy.size(), ++expectedSignalCount);
QWindowSystemInterface::handleScreenOrientationChange(screen, Qt::InvertedPortraitOrientation);
QWindowSystemInterface::flushWindowSystemEvents();
QTRY_COMPARE(screen->orientation(), Qt::InvertedPortraitOrientation);
- QCOMPARE(spy.count(), ++expectedSignalCount);
+ QCOMPARE(spy.size(), ++expectedSignalCount);
QWindowSystemInterface::handleScreenOrientationChange(screen, Qt::LandscapeOrientation);
QWindowSystemInterface::flushWindowSystemEvents();
QTRY_COMPARE(screen->orientation(), Qt::LandscapeOrientation);
- QCOMPARE(spy.count(), ++expectedSignalCount);
+ QCOMPARE(spy.size(), ++expectedSignalCount);
}
void tst_QScreen::grabWindow_data()
{
- if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(
- QPlatformIntegration::ScreenWindowGrabbing)) {
+ if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::ScreenWindowGrabbing)
+ || (QGuiApplication::platformName().toLower() == QStringLiteral("xcb") && !qEnvironmentVariableIsEmpty("WAYLAND_DISPLAY")))
QSKIP("This platform does not support grabbing windows on screen.");
- }
QTest::addColumn<int>("screenIndex");
QTest::addColumn<QByteArray>("screenName");
QTest::addColumn<bool>("grabWindow");