summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/widgets/qscrollbar
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/widgets/widgets/qscrollbar')
-rw-r--r--tests/auto/widgets/widgets/qscrollbar/CMakeLists.txt11
-rw-r--r--tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp10
2 files changed, 14 insertions, 7 deletions
diff --git a/tests/auto/widgets/widgets/qscrollbar/CMakeLists.txt b/tests/auto/widgets/widgets/qscrollbar/CMakeLists.txt
index fbaba594cf..23e31327e1 100644
--- a/tests/auto/widgets/widgets/qscrollbar/CMakeLists.txt
+++ b/tests/auto/widgets/widgets/qscrollbar/CMakeLists.txt
@@ -1,13 +1,20 @@
-# Generated from qscrollbar.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_qscrollbar Test:
#####################################################################
+if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+ cmake_minimum_required(VERSION 3.16)
+ project(tst_qscrollbar LANGUAGES CXX)
+ find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST)
+endif()
+
qt_internal_add_test(tst_qscrollbar
SOURCES
tst_qscrollbar.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Gui
Qt::TestPrivate
Qt::Widgets
diff --git a/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp b/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp
index a6e39bf273..fc836dec4a 100644
--- a/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.cpp
+++ b/tests/auto/widgets/widgets/qscrollbar/tst_qscrollbar.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 <QTest>
@@ -90,7 +90,7 @@ void tst_QScrollBar::task_209492()
QSignalSpy spy(verticalScrollBar, SIGNAL(actionTriggered(int)));
QCOMPARE(scrollArea.scrollCount, 0);
- QCOMPARE(spy.count(), 0);
+ QCOMPARE(spy.size(), 0);
// Simulate a mouse click on the "scroll down button".
const QPoint pressPoint(verticalScrollBar->width() / 2, verticalScrollBar->height() - 10);
@@ -109,7 +109,7 @@ void tst_QScrollBar::task_209492()
QSKIP("The result depends on system setting and is not relevant on Mac");
#endif
QCOMPARE(scrollArea.scrollCount, 1);
- QCOMPARE(spy.count(), 1);
+ QCOMPARE(spy.size(), 1);
}
#if QT_CONFIG(wheelevent)
@@ -159,7 +159,7 @@ void tst_QScrollBar::QTBUG_42871()
QSignalSpy spy(&scrollBarWidget, SIGNAL(actionTriggered(int)));
QVERIFY(spy.isValid());
QCOMPARE(myHandler.updatesCount, 0);
- QCOMPARE(spy.count(), 0);
+ QCOMPARE(spy.size(), 0);
// Simulate a mouse click on the "scroll down button".
const QPoint pressPoint(scrollBarWidget.width() / 2, scrollBarWidget.height() - 10);
@@ -180,7 +180,7 @@ void tst_QScrollBar::QTBUG_42871()
}
// Check that the action was triggered once.
QCOMPARE(myHandler.updatesCount, 1);
- QCOMPARE(spy.count(), myHandler.updatesCount);
+ QCOMPARE(spy.size(), myHandler.updatesCount);
}
QTEST_MAIN(tst_QScrollBar)