diff options
Diffstat (limited to 'tests/auto/widgets/styles')
15 files changed, 553 insertions, 226 deletions
diff --git a/tests/auto/widgets/styles/CMakeLists.txt b/tests/auto/widgets/styles/CMakeLists.txt index b1c9d1fce3..a957dfd373 100644 --- a/tests/auto/widgets/styles/CMakeLists.txt +++ b/tests/auto/widgets/styles/CMakeLists.txt @@ -1,9 +1,12 @@ -# Generated from styles.pro. +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause if(APPLE) add_subdirectory(qmacstyle) endif() -add_subdirectory(qstyle) +if(QT_FEATURE_private_tests) + add_subdirectory(qstyle) +endif() add_subdirectory(qstyleoption) if(QT_FEATURE_private_tests AND NOT ANDROID AND NOT QNX AND NOT UIKIT) add_subdirectory(qstylesheetstyle) diff --git a/tests/auto/widgets/styles/qmacstyle/CMakeLists.txt b/tests/auto/widgets/styles/qmacstyle/CMakeLists.txt index d4deeaf235..861a327418 100644 --- a/tests/auto/widgets/styles/qmacstyle/CMakeLists.txt +++ b/tests/auto/widgets/styles/qmacstyle/CMakeLists.txt @@ -1,13 +1,20 @@ -# Generated from qmacstyle.pro. +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause ##################################################################### ## tst_qmacstyle Test: ##################################################################### -qt_add_test(tst_qmacstyle +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qmacstyle LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + +qt_internal_add_test(tst_qmacstyle SOURCES tst_qmacstyle.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::Gui Qt::WidgetsPrivate ) diff --git a/tests/auto/widgets/styles/qmacstyle/qmacstyle.pro b/tests/auto/widgets/styles/qmacstyle/qmacstyle.pro deleted file mode 100644 index 90bf134ef1..0000000000 --- a/tests/auto/widgets/styles/qmacstyle/qmacstyle.pro +++ /dev/null @@ -1,4 +0,0 @@ -CONFIG += testcase -TARGET = tst_qmacstyle -QT += widgets-private testlib -SOURCES += tst_qmacstyle.cpp diff --git a/tests/auto/widgets/styles/qmacstyle/tst_qmacstyle.cpp b/tests/auto/widgets/styles/qmacstyle/tst_qmacstyle.cpp index 4a5702b709..9cfd50bc08 100644 --- a/tests/auto/widgets/styles/qmacstyle/tst_qmacstyle.cpp +++ b/tests/auto/widgets/styles/qmacstyle/tst_qmacstyle.cpp @@ -1,33 +1,8 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -#include <QtTest/QtTest> +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + + +#include <QTest> #include <QtWidgets> #include <private/qstylehelper_p.h> @@ -75,7 +50,7 @@ private: static int vgap(QWidget *widget1, QWidget *widget2) { return gap(widget1, widget2).height(); } static void setSize(QWidget *widget, QStyleHelper::WidgetSizePolicy size); static int spacing(ControlType control1, ControlType control2, Qt::Orientation orientation, - QStyleOption *option = 0, QWidget *widget = 0); + QStyleOption *option = nullptr, QWidget *widget = nullptr); static int hspacing(ControlType control1, ControlType control2, QStyleHelper::WidgetSizePolicy size = QStyleHelper::SizeLarge); static int vspacing(ControlType control1, ControlType control2, QStyleHelper::WidgetSizePolicy size = QStyleHelper::SizeLarge); }; @@ -83,6 +58,10 @@ private: #define SIZE(x, y, z) \ ((size == QStyleHelper::SizeLarge) ? (x) : (size == QStyleHelper::SizeSmall) ? (y) : (z)) +static bool bigSurOrAbove() { + return QOperatingSystemVersion::current() >= QOperatingSystemVersion::MacOSBigSur; +} + void tst_QMacStyle::sizeHints_data() { QTest::addColumn<QStyleHelper::WidgetSizePolicy>("size"); @@ -133,7 +112,7 @@ void tst_QMacStyle::sizeHints() QCOMPARE(sh(&comboBox3).height(), SIZE(32, -1, -1)); QSlider slider1(Qt::Horizontal, &w); - QCOMPARE(sh(&slider1).height(), SIZE(15, 12, 10)); + QCOMPARE(sh(&slider1).height(), SIZE(bigSurOrAbove() ? 18 : 15, 12, 10)); slider1.setTickPosition(QSlider::TicksAbove); QCOMPARE(sh(&slider1).height(), SIZE(24, 17, 16)); // Builder @@ -142,7 +121,7 @@ void tst_QMacStyle::sizeHints() QCOMPARE(sh(&slider1).height(), SIZE(24, 17, 16)); // Builder slider1.setTickPosition(QSlider::TicksBothSides); - QVERIFY(sh(&slider1).height() > SIZE(15, 12, 10)); // common sense + QVERIFY(sh(&slider1).height() > SIZE(bigSurOrAbove() ? 18 : 15, 12, 10)); // common sense QPushButton ok1("OK", &w); QPushButton cancel1("Cancel", &w); diff --git a/tests/auto/widgets/styles/qstyle/CMakeLists.txt b/tests/auto/widgets/styles/qstyle/CMakeLists.txt index 8f4a1a4159..2c617ebe49 100644 --- a/tests/auto/widgets/styles/qstyle/CMakeLists.txt +++ b/tests/auto/widgets/styles/qstyle/CMakeLists.txt @@ -1,13 +1,20 @@ -# Generated from qstyle.pro. +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause ##################################################################### ## tst_qstyle Test: ##################################################################### -qt_add_test(tst_qstyle +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qstyle LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + +qt_internal_add_test(tst_qstyle SOURCES tst_qstyle.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::Gui Qt::TestPrivate Qt::Widgets diff --git a/tests/auto/widgets/styles/qstyle/qstyle.pro b/tests/auto/widgets/styles/qstyle/qstyle.pro deleted file mode 100644 index 4dc0525c49..0000000000 --- a/tests/auto/widgets/styles/qstyle/qstyle.pro +++ /dev/null @@ -1,4 +0,0 @@ -CONFIG += testcase -TARGET = tst_qstyle -QT += widgets testlib testlib-private -SOURCES += tst_qstyle.cpp diff --git a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp index b7b9ab6423..95e24da21d 100644 --- a/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp +++ b/tests/auto/widgets/styles/qstyle/tst_qstyle.cpp @@ -1,33 +1,8 @@ -/**************************************************************************** -** -** Copyright (C) 2019 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -#include <QtTest/QtTest> +// Copyright (C) 2019 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + + +#include <QTest> #include <qlayout.h> #include "qstyle.h" #include <qevent.h> @@ -92,6 +67,11 @@ private slots: void testProxyCalled(); void testStyleOptionInit(); + + void sliderPositionFromValue_data(); + void sliderPositionFromValue(); + void sliderValueFromPosition_data(); + void sliderValueFromPosition(); private: bool testAllFunctions(QStyle *); bool testScrollBarSubControls(const QStyle *style); @@ -653,7 +633,7 @@ void tst_QStyle::testStyleOptionInit() QStringList keys = QStyleFactory::keys(); keys.prepend(QString()); // QCommonStyle marker - for (const QString &key : qAsConst(keys)) { + for (const QString &key : std::as_const(keys)) { QStyle* style = key.isEmpty() ? new QCommonStyle : QStyleFactory::create(key); TestStyleOptionInitProxy testStyle; testStyle.setBaseStyle(style); @@ -662,5 +642,108 @@ void tst_QStyle::testStyleOptionInit() } } +void tst_QStyle::sliderPositionFromValue_data() +{ + QTest::addColumn<int>("min"); + QTest::addColumn<int>("max"); + QTest::addColumn<int>("value"); + QTest::addColumn<int>("span"); + QTest::addColumn<bool>("upsideDown"); + QTest::addColumn<int>("position"); + + QTest::addRow("no span") << 12 << 56 << 34 << 0 << false << 0; + QTest::addRow("no span inverse") << 12 << 56 << 34 << 0 << true << 0; + + QTest::addRow("value too small") << 34 << 56 << 12 << 2000 << false << 0; + QTest::addRow("value too small inverse") << 34 << 56 << 12 << 2000 << true << 2000; + + QTest::addRow("no-range") << 12 << 12 << 12 << 2000 << false << 0; + QTest::addRow("no-range-inverse") << 12 << 12 << 12 << 2000 << true << 0; + + QTest::addRow("close-to-max") << 12 << 34 << 33 << 2000 << false << 1909; + QTest::addRow("at-max") << 12 << 34 << 34 << 2000 << false << 2000; + QTest::addRow("value too large") << 12 << 34 << 35 << 2000 << false << 2000; + QTest::addRow("close-to-max-inverse") << 12 << 34 << 33 << 2000 << true << 91; + QTest::addRow("at-max-inverse") << 12 << 34 << 34 << 2000 << true << 0; + QTest::addRow("value too large-inverse") << 12 << 34 << 35 << 2000 << true << 0; + + QTest::addRow("big-range") << 100000 << 700000 << 250000 << 2000 << false << 500; + QTest::addRow("big-range-inverse") << 100000 << 700000 << 250000 << 2000 << true << 1500; + + QTest::addRow("across-zero") << -1000 << 1000 << -500 << 100 << false << 25; + QTest::addRow("across-zero-inverse") << -1000 << 1000 << -500 << 100 << true << 75; + + QTest::addRow("span>range") << 0 << 100 << 60 << 2000 << false << 1200; + QTest::addRow("span>range-inverse") << 0 << 100 << 60 << 2000 << true << 800; + + QTest::addRow("overflow1 (QTBUG-101581)") << -1 << INT_MAX << 235 << 891 << false << 0; + QTest::addRow("overflow2") << INT_MIN << INT_MAX << 10 << 100 << false << 50; + QTest::addRow("overflow2-inverse") << INT_MIN << INT_MAX << 10 << 100 << true << 49; + QTest::addRow("overflow3") << INT_MIN << INT_MAX << -10 << 100 << false << 49; + QTest::addRow("overflow3-inverse") << INT_MIN << INT_MAX << -10 << 100 << true << 50; +} + +void tst_QStyle::sliderPositionFromValue() +{ + QFETCH(int, min); + QFETCH(int, max); + QFETCH(int, value); + QFETCH(int, span); + QFETCH(bool, upsideDown); + QFETCH(int, position); + + QCOMPARE(QStyle::sliderPositionFromValue(min, max, value, span, upsideDown), position); +} + +void tst_QStyle::sliderValueFromPosition_data() +{ + QTest::addColumn<int>("min"); + QTest::addColumn<int>("max"); + QTest::addColumn<int>("position"); + QTest::addColumn<int>("span"); + QTest::addColumn<bool>("upsideDown"); + QTest::addColumn<int>("value"); + + QTest::addRow("position zero") << 0 << 100 << 0 << 2000 << false << 0; + QTest::addRow("position zero inverse") << 0 << 100 << 0 << 2000 << true << 100; + + QTest::addRow("span zero") << 0 << 100 << 1200 << 0 << false << 0; + QTest::addRow("span zero inverse") << 0 << 100 << 1200 << 0 << true << 100; + + QTest::addRow("position > span") << -300 << -200 << 2 << 1 << false << -200; + QTest::addRow("position > span inverse") << -300 << -200 << 2 << 1 << true << -300; + + QTest::addRow("large") << 0 << 100 << 1200 << 2000 << false << 60; + QTest::addRow("large-inverse") << 0 << 100 << 1200 << 2000 << true << 40; + + QTest::addRow("normal") << 0 << 100 << 12 << 20 << false << 60; + QTest::addRow("inverse") << 0 << 100 << 12 << 20 << true << 40; + + QTest::addRow("overflow1") << -1 << INT_MAX << 10 << 10 << false << INT_MAX; + QTest::addRow("overflow1-inverse") << -1 << INT_MAX << 10 << 10 << true << -1; + QTest::addRow("overflow2") << INT_MIN << INT_MAX << 5 << 10 << false << 0; + QTest::addRow("overflow2-inverse") << INT_MIN << INT_MAX << 5 << 10 << true << -1; + QTest::addRow("overflow3") << INT_MIN << 0 << 0 << 10 << false << INT_MIN; + QTest::addRow("overflow3-inverse") << INT_MIN << 0 << 0 << 10 << true << 0; + + QTest::addRow("overflow4") << 0 << INT_MAX << INT_MAX/2-6 << INT_MAX/2-5 << false << INT_MAX-2; + QTest::addRow("overflow4-inverse") << 0 << INT_MAX << INT_MAX/2-6 << INT_MAX/2-5 << true << 2; + + QTest::addRow("overflow5") << 0 << 4 << INT_MAX/4 << INT_MAX << false << 1; + QTest::addRow("overflow5-inverse") << 0 << 4 << INT_MAX/4 << INT_MAX << true << 3; +} + +void tst_QStyle::sliderValueFromPosition() +{ + QFETCH(int, min); + QFETCH(int, max); + QFETCH(int, position); + QFETCH(int, span); + QFETCH(bool, upsideDown); + QFETCH(int, value); + + QCOMPARE(QStyle::sliderValueFromPosition(min, max, position, span, upsideDown), value); +} + QTEST_MAIN(tst_QStyle) #include "tst_qstyle.moc" diff --git a/tests/auto/widgets/styles/qstyleoption/CMakeLists.txt b/tests/auto/widgets/styles/qstyleoption/CMakeLists.txt index d023a2f36f..e0a4cc38e2 100644 --- a/tests/auto/widgets/styles/qstyleoption/CMakeLists.txt +++ b/tests/auto/widgets/styles/qstyleoption/CMakeLists.txt @@ -1,16 +1,20 @@ -# Generated from qstyleoption.pro. +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause ##################################################################### ## tst_qstyleoption Test: ##################################################################### -qt_add_test(tst_qstyleoption +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qstyleoption LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + +qt_internal_add_test(tst_qstyleoption SOURCES tst_qstyleoption.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::Gui Qt::Widgets ) - -#### Keys ignored in scope 1:.:.:qstyleoption.pro:<TRUE>: -# TEMPLATE = "app" diff --git a/tests/auto/widgets/styles/qstyleoption/qstyleoption.pro b/tests/auto/widgets/styles/qstyleoption/qstyleoption.pro deleted file mode 100644 index bf12a6b30f..0000000000 --- a/tests/auto/widgets/styles/qstyleoption/qstyleoption.pro +++ /dev/null @@ -1,7 +0,0 @@ -TEMPLATE = app -TARGET = tst_qstyleoption - -CONFIG += testcase -QT += widgets testlib - -SOURCES += tst_qstyleoption.cpp diff --git a/tests/auto/widgets/styles/qstyleoption/tst_qstyleoption.cpp b/tests/auto/widgets/styles/qstyleoption/tst_qstyleoption.cpp index 1d46886d1c..f173c9a8df 100644 --- a/tests/auto/widgets/styles/qstyleoption/tst_qstyleoption.cpp +++ b/tests/auto/widgets/styles/qstyleoption/tst_qstyleoption.cpp @@ -1,33 +1,8 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -#include <QtTest/QtTest> +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + + +#include <QTest> #include <QStyleOption> @@ -45,16 +20,16 @@ struct StyleOptionPointerBase { QStyleOption *pointer; - StyleOptionPointerBase(QStyleOption *p = 0) : pointer(p) { } + StyleOptionPointerBase(QStyleOption *p = nullptr) : pointer(p) { } - virtual ~StyleOptionPointerBase() { pointer = 0; } + virtual ~StyleOptionPointerBase() { pointer = nullptr; } }; template <typename T> struct StyleOptionPointer: public StyleOptionPointerBase { - StyleOptionPointer(T *p = 0): StyleOptionPointerBase(p) {} - ~StyleOptionPointer() { delete static_cast<T *>(pointer); pointer = 0; } + StyleOptionPointer(T *p = nullptr): StyleOptionPointerBase(p) {} + ~StyleOptionPointer() { delete static_cast<T *>(pointer); pointer = nullptr; } }; Q_DECLARE_METATYPE(StyleOptionPointerBase*) @@ -94,25 +69,25 @@ void tst_QStyleOption::qstyleoptioncast() QFETCH(bool, canCastToComplex); QFETCH(int, type); - QVERIFY(testOption->pointer != 0); + QVERIFY(testOption->pointer != nullptr); QCOMPARE(testOption->pointer->type, type); // Cast to common base class QStyleOption *castOption = qstyleoption_cast<QStyleOption*>(testOption->pointer); - QVERIFY(castOption != 0); + QVERIFY(castOption != nullptr); // Cast to complex base class castOption = qstyleoption_cast<QStyleOptionComplex*>(testOption->pointer); - QCOMPARE(canCastToComplex, (castOption != 0)); + QCOMPARE(canCastToComplex, (castOption != nullptr)); // Cast to combo box castOption = qstyleoption_cast<QStyleOptionComboBox*>(testOption->pointer); - QCOMPARE((castOption != 0),(testOption->pointer->type == QStyleOption::SO_ComboBox)); + QCOMPARE((castOption != nullptr),(testOption->pointer->type == QStyleOption::SO_ComboBox)); // Cast to button castOption = qstyleoption_cast<QStyleOptionButton*>(testOption->pointer); - QCOMPARE((castOption != 0),(testOption->pointer->type == QStyleOption::SO_Button)); + QCOMPARE((castOption != nullptr),(testOption->pointer->type == QStyleOption::SO_Button)); // Cast to lower version testOption->pointer->version += 1; diff --git a/tests/auto/widgets/styles/qstylesheetstyle/BLACKLIST b/tests/auto/widgets/styles/qstylesheetstyle/BLACKLIST index 616cd650b3..00ff17aaa8 100644 --- a/tests/auto/widgets/styles/qstylesheetstyle/BLACKLIST +++ b/tests/auto/widgets/styles/qstylesheetstyle/BLACKLIST @@ -2,3 +2,9 @@ osx [widgetStylePropagation] macos # QTBUG-75786 +[focusColors] +ci b2qt 32bit +[hoverColors] +ci b2qt 32bit +[task232085_spinBoxLineEditBg] +ci b2qt 32bit diff --git a/tests/auto/widgets/styles/qstylesheetstyle/CMakeLists.txt b/tests/auto/widgets/styles/qstylesheetstyle/CMakeLists.txt index 06c7a36edc..6543ec9961 100644 --- a/tests/auto/widgets/styles/qstylesheetstyle/CMakeLists.txt +++ b/tests/auto/widgets/styles/qstylesheetstyle/CMakeLists.txt @@ -1,23 +1,15 @@ -# Generated from qstylesheetstyle.pro. - -if(NOT QT_FEATURE_private_tests) - return() -endif() +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause ##################################################################### ## tst_qstylesheetstyle Test: ##################################################################### -qt_add_test(tst_qstylesheetstyle - SOURCES - tst_qstylesheetstyle.cpp - PUBLIC_LIBRARIES - Qt::Gui - Qt::GuiPrivate - Qt::TestPrivate - Qt::Widgets - Qt::WidgetsPrivate -) +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qstylesheetstyle LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() # Resources: set(resources_resource_files @@ -25,13 +17,17 @@ set(resources_resource_files "images/testimage@2x.png" ) -qt_add_resource(tst_qstylesheetstyle "resources" - PREFIX - "/" - FILES - ${resources_resource_files} +qt_internal_add_test(tst_qstylesheetstyle + SOURCES + tst_qstylesheetstyle.cpp + LIBRARIES + Qt::Gui + Qt::GuiPrivate + Qt::TestPrivate + Qt::Widgets + Qt::WidgetsPrivate + TESTDATA ${resources_resource_files} + BUILTIN_TESTDATA ) - -#### Keys ignored in scope 1:.:.:qstylesheetstyle.pro:<TRUE>: # _REQUIREMENTS = "qtConfig(private_tests)" diff --git a/tests/auto/widgets/styles/qstylesheetstyle/qstylesheetstyle.pro b/tests/auto/widgets/styles/qstylesheetstyle/qstylesheetstyle.pro deleted file mode 100644 index 3bf1b94050..0000000000 --- a/tests/auto/widgets/styles/qstylesheetstyle/qstylesheetstyle.pro +++ /dev/null @@ -1,8 +0,0 @@ -CONFIG += testcase -TARGET = tst_qstylesheetstyle -QT += widgets widgets-private gui-private testlib testlib-private - -SOURCES += tst_qstylesheetstyle.cpp -RESOURCES += resources.qrc - -requires(qtConfig(private_tests)) diff --git a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp index a751fae05d..a9a1817b8a 100644 --- a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp +++ b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp @@ -1,30 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2019 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2019 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtWidgets/QApplication> #include <QtWidgets/QCheckBox> @@ -54,7 +29,7 @@ #include <QtGui/QPainter> #include <QtGui/QScreen> -#include <QtTest/QtTest> +#include <QTest> #include <QtCore/QDebug> #include <QtCore/QMetaObject> @@ -63,6 +38,8 @@ #include <private/qstylesheetstyle_p.h> #include <private/qhighdpiscaling_p.h> #include <QtTest/private/qtesthelpers_p.h> +#include <qpa/qplatformtheme.h> +#include <QtWidgets/private/qapplication_p.h> using namespace QTestPrivate; @@ -77,6 +54,7 @@ private slots: void cleanup(); void repolish(); void repolish_without_crashing(); + void repolish_children(); void numinstances(); void widgetsBeforeAppStyleSheet(); void widgetsAfterAppStyleSheet(); @@ -92,6 +70,7 @@ private slots: void layoutSpacing(); #endif void qproperty(); + void qproperty_styleSheet(); void palettePropagation_data(); void palettePropagation(); void fontPropagation_data(); @@ -106,6 +85,8 @@ private slots: #endif void background(); void tabAlignment(); + void tabFont_data(); + void tabFont(); void attributesList(); void minmaxSizes(); void task206238_twice(); @@ -113,6 +94,7 @@ private slots: void proxyStyle(); void dialogButtonBox(); void emptyStyleSheet(); + void toolTip_data(); void toolTip(); void embeddedFonts(); void opaquePaintEvent_data(); @@ -124,6 +106,10 @@ private slots: void QTBUG15910_crashNullWidget(); void QTBUG36933_brokenPseudoClassLookup(); void styleSheetChangeBeforePolish(); + void placeholderColor(); + void accent(); + void enumPropertySelector_data(); + void enumPropertySelector(); //at the end because it mess with the style. void widgetStyle(); void appStyle(); @@ -134,6 +120,11 @@ private slots: void highdpiImages_data(); void highdpiImages(); + void iconSizes_data(); + void iconSizes(); + void inheritWidgetPalette_data(); + void inheritWidgetPalette(); + private: static QColor COLOR(const QWidget &w) { @@ -434,6 +425,19 @@ void tst_QStyleSheetStyle::repolish_without_crashing() QCOMPARE(COLOR(*label), QColor(Qt::red)); } +void tst_QStyleSheetStyle::repolish_children() +{ + QWidget parent; + parent.setStyleSheet("QPushButton { color: red; background: white }"); + QPushButton p2(&parent); + // a layout would call show, triggering a polish of the child while + // the parent on which the style sheet is set remains unpolished + p2.show(); + QCOMPARE(BACKGROUND(p2), Qt::white); + parent.setStyleSheet("QPushButton { color: red; background: red }"); + QCOMPARE(BACKGROUND(p2), Qt::red); +} + void tst_QStyleSheetStyle::widgetStyle() { qApp->setStyleSheet(QString()); @@ -669,6 +673,23 @@ void tst_QStyleSheetStyle::qproperty() QCOMPARE(pb.isChecked(), false); } +void tst_QStyleSheetStyle::qproperty_styleSheet() +{ + QWidget w; + auto checkBox = new QCheckBox("check", &w); + QString sheet = R"(QCheckBox { qproperty-styleSheet: "QCheckBox { qproperty-text: foobar; }"; })"; + + QVERIFY(w.property("styleSheet").toString().isEmpty()); + + w.setStyleSheet(sheet); + QCOMPARE(checkBox->text(), "check"); + + //recursion crash + w.ensurePolished(); + QCOMPARE(w.property("styleSheet").toString(), sheet); + QCOMPARE(checkBox->text(), "foobar"); +} + namespace ns { class PushButton1 : public QPushButton { Q_OBJECT @@ -944,7 +965,7 @@ void tst_QStyleSheetStyle::focusColors() // ten pixels of the right color requires quite a many characters, as the // majority of the pixels will have slightly different colors due to the // anti-aliasing effect. -#if !defined(Q_OS_WIN32) && !(defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(Q_CC_INTEL)) +#if !defined(Q_OS_WIN32) && !(defined(Q_OS_LINUX) && defined(Q_CC_GNU)) QSKIP("This is a fragile test which fails on many esoteric platforms because of focus problems" " (for example, QTBUG-33959)." "That doesn't mean that the feature doesn't work in practice."); @@ -959,7 +980,6 @@ void tst_QStyleSheetStyle::focusColors() centerOnScreen(&frame); frame.show(); - QApplication::setActiveWindow(&frame); QVERIFY(QTest::qWaitForWindowActive(&frame)); for (QWidget *widget : frame.widgets()) { @@ -1005,7 +1025,6 @@ void tst_QStyleSheetStyle::hoverColors() QCursor::setPos(frame.geometry().topLeft() - QPoint(100, 0)); frame.show(); - QApplication::setActiveWindow(&frame); QVERIFY(QTest::qWaitForWindowActive(&frame)); QWindow *frameWindow = frame.windowHandle(); @@ -1178,6 +1197,100 @@ void tst_QStyleSheetStyle::tabAlignment() QVERIFY(bar->geometry().top() > 100); } +void tst_QStyleSheetStyle::tabFont_data() +{ + QTest::addColumn<QFont>("tabFont"); + QTest::addColumn<QTabWidget::TabPosition>("tabPosition"); + QTest::addColumn<bool>("closable"); + + QFont medium; + medium.setPixelSize(24); + QFont large; + large.setPixelSize(36); + QFont bold; + bold.setBold(true); + + QTest::newRow("medium, horizontal") << medium << QTabWidget::North << false; + QTest::newRow("large, vertical") << large << QTabWidget::West << false; + QTest::newRow("bold, horizontal, closable") << bold << QTabWidget::North << true; + QTest::newRow("bold, vertical, closable") << bold << QTabWidget::West << true; +} + +void tst_QStyleSheetStyle::tabFont() +{ + QFETCH(QFont, tabFont); + QFETCH(QTabWidget::TabPosition, tabPosition); + QFETCH(bool, closable); + const bool vertical = tabPosition == QTabWidget::West || tabPosition == QTabWidget::East; + const QString tab0Text("Tab title"); + const QString tab1Text("Very Long Tab title"); + + // macOS style centers tabs and messes up the test + QWindowsStyle windowsStyle; + QWidget topLevel; + topLevel.setStyle(&windowsStyle); + topLevel.setWindowTitle(QTest::currentTestFunction()); + QTabWidget tabWidget; + tabWidget.setStyle(&windowsStyle); + tabWidget.setTabPosition(tabPosition); + tabWidget.addTab(new QWidget, tab0Text); + tabWidget.addTab(new QWidget, tab1Text); + QTabWidget styledWidget; + styledWidget.setStyle(&windowsStyle); + styledWidget.setTabPosition(tabPosition); + styledWidget.addTab(new QWidget, tab0Text); + styledWidget.addTab(new QWidget, tab1Text); + + QTabBar *bar = tabWidget.tabBar(); + QTabBar *styledBar = styledWidget.tabBar(); + QVERIFY(bar && styledBar); + bar->setStyle(&windowsStyle); + bar->setTabsClosable(closable); + styledBar->setStyle(&windowsStyle); + styledBar->setTabsClosable(closable); + + QBoxLayout box(vertical ? QBoxLayout::LeftToRight : QBoxLayout::TopToBottom); + box.addWidget(&tabWidget); + box.addWidget(&styledWidget); + topLevel.setLayout(&box); + + topLevel.resize(600, 600); + centerOnScreen(&topLevel); + topLevel.show(); + QVERIFY(QTest::qWaitForWindowExposed(&topLevel)); + + const QFont defaultFont = tabWidget.font(); + if (QFontMetrics(defaultFont).size(Qt::TextShowMnemonic, tab0Text).width() >= + QFontMetrics(tabFont).size(Qt::TextShowMnemonic, tab0Text).width()) { + QSKIP("The used font is not larger when bold"); + } + + const QRect defaultRect = bar->tabRect(0); + QCOMPARE(styledBar->tabRect(0), defaultRect); + + tabWidget.setFont(tabFont); + const QRect rectWithFont = bar->tabRect(0); + if (vertical) + QVERIFY(rectWithFont.height() > defaultRect.height()); + else + QVERIFY(rectWithFont.width() > defaultRect.width()); + + QString styleSheet = "QTabBar::tab:first {"; + if (tabFont.pixelSize() != -1) + styleSheet += QString(" font-size: %1px;").arg(tabFont.pixelSize()); + if (tabFont.bold()) + styleSheet += " font-weight: bold;"; + styleSheet += "}"; + + styledWidget.setStyleSheet(styleSheet); + const QRect rectWithStyle = styledBar->tabRect(0); + + if (vertical) + QCOMPARE(rectWithStyle.height(), rectWithFont.height()); + else + QCOMPARE(rectWithStyle.width(), rectWithFont.width()); +} + void tst_QStyleSheetStyle::attributesList() { const QColor blue(Qt::blue); @@ -1544,19 +1657,32 @@ private: const QString m_oldStyleName; }; +void tst_QStyleSheetStyle::toolTip_data() +{ + QTest::addColumn<QString>("style"); + + QTest::newRow("fusion") << QString("Fusion"); +#ifdef Q_OS_WINDOWS + QTest::newRow("windowsvista") << QString("WindowsVista"); +#endif +} + void tst_QStyleSheetStyle::toolTip() { + QFETCH(QString, style); + if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) QSKIP("Wayland: This fails. Figure out why."); - qApp->setStyleSheet(QString()); QWidget w; w.resize(m_testSize); w.setWindowTitle(QTest::currentTestFunction()); + // Use "Fusion" to prevent the Vista style from clobbering the tooltip palette in polish(). - QStyle *fusionStyle = QStyleFactory::create(QLatin1String("Fusion")); - QVERIFY(fusionStyle); - ApplicationStyleSetter as(fusionStyle); + QStyle *appStyle = QStyleFactory::create(style); + QVERIFY(appStyle); + ApplicationStyleSetter as(appStyle); + QHBoxLayout layout(&w); w.setLayout(&layout); @@ -1584,37 +1710,65 @@ void tst_QStyleSheetStyle::toolTip() wid4->setToolTip("this is wid4"); wid4->setObjectName("wid4"); + QWidget *wid5 = new QPushButton("wid5", &w); + layout.addWidget(wid5); + wid5->setStyleSheet("QToolTip { background: #ff0; color: #f00 }"); + wid5->setToolTip("this is wid5"); + wid5->setObjectName("wid5"); + centerOnScreen(&w); w.show(); - QApplication::setActiveWindow(&w); QVERIFY(QTest::qWaitForWindowActive(&w)); - const QColor normalToolTip = QToolTip::palette().color(QPalette::Inactive, QPalette::ToolTipBase); + QColor normalToolTipBgColor = QToolTip::palette().color(QPalette::Inactive, QPalette::ToolTipBase); + +#ifdef Q_OS_MACOS + // macOS uses tool tip text color set in label palette + const QPalette *labelPalette = QGuiApplicationPrivate::platformTheme()->palette(QPlatformTheme::LabelPalette); + QColor normalToolTipFgColor = labelPalette->color(QPalette::Inactive, QPalette::ToolTipText); +#else + QColor normalToolTipFgColor = QToolTip::palette().color(QPalette::Inactive, QPalette::ToolTipText); +#endif + // Tooltip on the widget without stylesheet, then to other widget, // including one without stylesheet (the tooltip will be reused, // but its color must change) - const QWidgetList widgets{wid4, wid1, wid2, wid3, wid4}; - const QList<QColor> colors { normalToolTip, QColor("#ae2"), QColor("#f81"), QColor("#0b8"), - normalToolTip }; + const QWidgetList widgets{wid4, wid1, wid2, wid3, wid4, wid5}; + const QList<QColor> bgcolors { normalToolTipBgColor, QColor("#ae2"), QColor("#f81"), + QColor("#0b8"), normalToolTipBgColor, QColor("#ff0")}; + const QList<QColor> fgcolors { normalToolTipFgColor, normalToolTipFgColor, normalToolTipFgColor, + normalToolTipFgColor, normalToolTipFgColor, QColor("#f00")}; QWidgetList topLevels; - for (int i = 0; i < widgets.count() ; ++i) { + for (int i = 0; i < widgets.size() ; ++i) { QWidget *wid = widgets.at(i); - QColor col = colors.at(i); + QColor bgColor = bgcolors.at(i); + QColor fgColor = fgcolors.at(i); QToolTip::showText( QPoint(0,0) , "This is " + wid->objectName(), wid); topLevels = QApplication::topLevelWidgets(); QWidget *tooltip = nullptr; - for (QWidget *widget : qAsConst(topLevels)) { + for (QWidget *widget : std::as_const(topLevels)) { if (widget->inherits("QTipLabel")) { tooltip = widget; break; } } + QVERIFY(tooltip); QTRY_VERIFY(tooltip->isVisible()); // Wait until Roll-Effect is finished (Windows Vista) - QCOMPARE(tooltip->palette().color(tooltip->backgroundRole()), col); + +#ifdef Q_OS_WINDOWS + // If tooltip palette contains empty resolve mask, validate with inherited palette + if (!tooltip->palette().resolveMask()) { + bgColor = w.palette().color(tooltip->backgroundRole()); + fgColor = w.palette().color(tooltip->foregroundRole()); + } +#endif + + QCOMPARE(tooltip->palette().color(tooltip->backgroundRole()), bgColor); + QCOMPARE(tooltip->palette().color(tooltip->foregroundRole()), fgColor); } QToolTip::showText( QPoint(0,0) , "This is " + wid3->objectName(), wid3); @@ -1622,7 +1776,7 @@ void tst_QStyleSheetStyle::toolTip() delete wid3; //should not crash; QTest::qWait(10); topLevels = QApplication::topLevelWidgets(); - for (QWidget *widget : qAsConst(topLevels)) + for (QWidget *widget : std::as_const(topLevels)) widget->update(); //should not crash either } @@ -1732,7 +1886,6 @@ void tst_QStyleSheetStyle::complexWidgetFocus() centerOnScreen(&frame); frame.show(); - QApplication::setActiveWindow(&frame); QVERIFY(QTest::qWaitForWindowActive(&frame)); for (QWidget *widget : widgets) { widget->setFocus(); @@ -1821,7 +1974,6 @@ void tst_QStyleSheetStyle::task232085_spinBoxLineEditBg() centerOnScreen(&frame); frame.show(); - QApplication::setActiveWindow(&frame); spinbox->setFocus(); QVERIFY(QTest::qWaitForWindowActive(&frame)); @@ -1957,7 +2109,6 @@ void tst_QStyleSheetStyle::QTBUG36933_brokenPseudoClassLookup() QVERIFY(QTest::qWaitForWindowExposed(&widget)); widget.activateWindow(); - QApplication::setActiveWindow(&widget); QVERIFY(QTest::qWaitForWindowActive(&widget)); QHeaderView *verticalHeader = widget.verticalHeader(); @@ -2222,6 +2373,161 @@ void tst_QStyleSheetStyle::highdpiImages() QHighDpiScaling::updateHighDpiScaling(); // reset to normal } +void tst_QStyleSheetStyle::placeholderColor() +{ + const QColor red(Qt::red); + qApp->setStyleSheet("* { color: red; }"); + QLineEdit le1; + QLineEdit le2; + le2.setEnabled(false); + le1.ensurePolished(); + QColor phColor = le1.palette().placeholderText().color(); + QCOMPARE(phColor.rgb(), red.rgb()); + QVERIFY(phColor.alpha() < red.alpha()); + + le2.ensurePolished(); + phColor = le2.palette().placeholderText().color(); + QCOMPARE(phColor.rgb(), red.rgb()); + QVERIFY(phColor.alpha() < red.alpha()); + + le2.setEnabled(true); + phColor = le2.palette().placeholderText().color(); + QCOMPARE(phColor.rgb(), red.rgb()); + QVERIFY(phColor.alpha() < red.alpha()); + + const char *phSpec = "#aabbccdd"; + le1.setStyleSheet(QString("QLineEdit { placeholder-text-color: %1; }").arg(phSpec)); + QCOMPARE(le1.palette().placeholderText().color(), QColor(phSpec)); +} + +void tst_QStyleSheetStyle::accent() +{ + QLineEdit lineEdit; + const QColor universe(42, 42, 42); + lineEdit.setStyleSheet(QString("QLineEdit { accent-color: %1; }").arg(universe.name())); + lineEdit.ensurePolished(); + QCOMPARE(lineEdit.palette().accent().color(), universe); +} + +void tst_QStyleSheetStyle::enumPropertySelector_data() +{ + QTest::addColumn<QString>("styleSheet"); + + QTest::addRow("Enum value") << R"(QToolButton[popupMode=MenuButtonPopup] { padding-right: 40px; })"; + QTest::addRow("Int value") << R"(QToolButton[popupMode="1"] { padding-right: 40px; })"; +} + +void tst_QStyleSheetStyle::enumPropertySelector() +{ + QFETCH(QString, styleSheet); + + QToolButton button; + QMenu menu; + menu.addAction("Action1"); + QPixmap pm(50, 50); + pm.fill(Qt::red); + button.setIcon(pm); + button.setMenu(&menu); + button.setPopupMode(QToolButton::MenuButtonPopup); + + button.show(); + const QSize unstyledSizeHint = button.sizeHint(); + + qApp->setStyleSheet(styleSheet); + const QSize styledSizeHint = button.sizeHint(); + +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + QEXPECT_FAIL("Enum value", "In Qt 5, style sheet selectors have to use integer enum values", Continue); +#endif + + QVERIFY(styledSizeHint.width() > unstyledSizeHint.width()); +} + +void tst_QStyleSheetStyle::iconSizes_data() +{ + QTest::addColumn<QString>("styleSheet"); + QTest::addColumn<QFont>("font"); + QTest::addColumn<QSize>("iconSize"); + + const int defaultSize = QApplication::style()->pixelMetric(QStyle::PM_ButtonIconSize); + + QFont smallFont; + smallFont.setPointSizeF(9.0); + QFont largeFont; + largeFont.setPointSizeF(24.0); + QFont hugeFont; + hugeFont.setPointSizeF(40.0); + + QTest::addRow("default") << QString() << QFont() << QSize(defaultSize, defaultSize); + QTest::addRow("pixels") << "icon-size: 50px" << QFont() << QSize(50, 50); + QTest::addRow("points") << "icon-size: 20pt" << QFont() << QSize(15, 15); + QTest::addRow("pixels with font") << "icon-size: 50px" << smallFont << QSize(50, 50); + QTest::addRow("points with font") << "icon-size: 20pt" << largeFont << QSize(15, 15); + + const QFontMetrics defaultMetrics{QFont()}; + const QFontMetrics smallMetrics(smallFont); + const QFontMetrics largeMetrics(largeFont); + const QFontMetrics hugeMetrics(hugeFont); + QTest::addRow("1em, default font") << "icon-size: 1em" + << QFont() << QSize(defaultMetrics.height(), defaultMetrics.height()); + QTest::addRow("1em, small font") << "icon-size: 1em" + << smallFont << QSize(smallMetrics.height(), smallMetrics.height()); + QTest::addRow("1em, large font") << "icon-size: 1em" + << largeFont << QSize(largeMetrics.height(), largeMetrics.height()); + QTest::addRow("1.5em, lage font") << "icon-size: 1.5em" + << largeFont << QSize(largeMetrics.height(), largeMetrics.height()) * 1.5; + QTest::addRow("2em with styled font") << "font-size: 40pt; icon-size: 2em" + << QFont() << QSize(hugeMetrics.height(), hugeMetrics.height()) * 2; + + QTest::addRow("1ex, default font") << "icon-size: 1ex" + << QFont() << QSize(defaultMetrics.xHeight(), defaultMetrics.xHeight()); + QTest::addRow("1ex, small font") << "icon-size: 1ex" + << smallFont << QSize(smallMetrics.xHeight(), smallMetrics.xHeight()); + QTest::addRow("1ex, large font") << "icon-size: 1ex" + << largeFont << QSize(largeMetrics.xHeight(), largeMetrics.xHeight()); + QTest::addRow("1.5ex, lage font") << "icon-size: 1.5ex" + << largeFont << QSize(largeMetrics.xHeight(), largeMetrics.xHeight()) * 1.5; + QTest::addRow("2ex with styled font") << "font-size: 40pt; icon-size: 2ex" + << QFont() << QSize(hugeMetrics.xHeight(), hugeMetrics.xHeight()) * 2; +} + +void tst_QStyleSheetStyle::iconSizes() +{ + QFETCH(QString, styleSheet); + QFETCH(QFont, font); + QFETCH(QSize, iconSize); + + QPushButton button; + button.setFont(font); + button.setStyleSheet(styleSheet); + QCOMPARE(button.iconSize(), iconSize); +} + +void tst_QStyleSheetStyle::inheritWidgetPalette_data() +{ + QTest::addColumn<const QString>("styleSheet"); + QTest::addColumn<const QColor>("phColorPalette"); + + QTest::addRow("blueAndGreen") << "QLineEdit {color: rgb(0,0,255);}" << QColor(Qt::green); + QTest::addRow("emptyStyleSheet") << QString() << QColor(Qt::green); + +} + +void tst_QStyleSheetStyle::inheritWidgetPalette() +{ + QFETCH(const QString, styleSheet); + QFETCH(const QColor, phColorPalette); + + QLineEdit edit; + QPalette palette = edit.palette(); + palette.setBrush(QPalette::PlaceholderText, phColorPalette); + edit.setPalette(palette); + edit.setStyleSheet(styleSheet); + const QColor phColor = edit.palette().placeholderText().color(); + + QCOMPARE(phColor, phColorPalette); +} + QTEST_MAIN(tst_QStyleSheetStyle) #include "tst_qstylesheetstyle.moc" diff --git a/tests/auto/widgets/styles/styles.pro b/tests/auto/widgets/styles/styles.pro deleted file mode 100644 index 9d7464cb5b..0000000000 --- a/tests/auto/widgets/styles/styles.pro +++ /dev/null @@ -1,16 +0,0 @@ -TEMPLATE=subdirs -SUBDIRS=\ - qmacstyle \ - qstyle \ - qstyleoption \ - qstylesheetstyle \ - -!qtConfig(private_tests): SUBDIRS -= \ - qstylesheetstyle \ - -# This test can only be run on Mac OS: -!mac:SUBDIRS -= \ - qmacstyle \ - -uikit|android|qnx: SUBDIRS -= \ - qstylesheetstyle \ |