diff options
Diffstat (limited to 'tests/auto/widgets/widgets/qprogressbar')
-rw-r--r-- | tests/auto/widgets/widgets/qprogressbar/CMakeLists.txt | 11 | ||||
-rw-r--r-- | tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp | 6 |
2 files changed, 12 insertions, 5 deletions
diff --git a/tests/auto/widgets/widgets/qprogressbar/CMakeLists.txt b/tests/auto/widgets/widgets/qprogressbar/CMakeLists.txt index 7a66a722ab..61ce6c2692 100644 --- a/tests/auto/widgets/widgets/qprogressbar/CMakeLists.txt +++ b/tests/auto/widgets/widgets/qprogressbar/CMakeLists.txt @@ -1,16 +1,21 @@ # Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 - -# Generated from qprogressbar.pro. +# SPDX-License-Identifier: BSD-3-Clause ##################################################################### ## tst_qprogressbar Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qprogressbar LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qprogressbar SOURCES tst_qprogressbar.cpp LIBRARIES Qt::Gui Qt::Widgets + Qt::WidgetsPrivate ) diff --git a/tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp b/tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp index abe29345d2..4a90ed6667 100644 --- a/tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp +++ b/tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.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> @@ -11,6 +11,8 @@ #include <qtimer.h> #include <QStyleFactory> +#include <QtWidgets/private/qapplication_p.h> + class tst_QProgressBar : public QObject { Q_OBJECT @@ -223,7 +225,7 @@ void tst_QProgressBar::setMinMaxRepaint() pbar.setFormat("%v"); pbar.move(300, 300); pbar.show(); - qApp->setActiveWindow(&pbar); + QApplicationPrivate::setActiveWindow(&pbar); QVERIFY(QTest::qWaitForWindowActive(&pbar)); // No repaint when setting minimum to the current minimum |