diff options
Diffstat (limited to 'tests/auto/gui/text/qtextformat')
-rw-r--r-- | tests/auto/gui/text/qtextformat/CMakeLists.txt | 6 | ||||
-rw-r--r-- | tests/auto/gui/text/qtextformat/tst_qtextformat.cpp | 8 |
2 files changed, 13 insertions, 1 deletions
diff --git a/tests/auto/gui/text/qtextformat/CMakeLists.txt b/tests/auto/gui/text/qtextformat/CMakeLists.txt index e5b714ad9f..4dea90900e 100644 --- a/tests/auto/gui/text/qtextformat/CMakeLists.txt +++ b/tests/auto/gui/text/qtextformat/CMakeLists.txt @@ -5,6 +5,12 @@ ## tst_qtextformat Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qtextformat LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + qt_internal_add_test(tst_qtextformat SOURCES tst_qtextformat.cpp diff --git a/tests/auto/gui/text/qtextformat/tst_qtextformat.cpp b/tests/auto/gui/text/qtextformat/tst_qtextformat.cpp index 1b28274748..6c6145561d 100644 --- a/tests/auto/gui/text/qtextformat/tst_qtextformat.cpp +++ b/tests/auto/gui/text/qtextformat/tst_qtextformat.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> @@ -7,7 +7,9 @@ #include <qcoreapplication.h> #include <qdebug.h> +#if QT_CONFIG(settings) #include <qsettings.h> +#endif #include <qtextformat.h> #include <private/qtextformat_p.h> #include <qtextdocument.h> @@ -27,7 +29,9 @@ Q_OBJECT private slots: void getSetCheck(); void defaultAlignment(); +#if QT_CONFIG(settings) void testQTextCharFormat() const; +#endif void testUnderlinePropertyPrecedence(); void toFormat(); void resolveFont(); @@ -47,6 +51,7 @@ private slots: #endif }; +#if QT_CONFIG(settings) /*! \internal This (used to) trigger a crash in: @@ -61,6 +66,7 @@ void tst_QTextFormat::testQTextCharFormat() const settings.value("test", test); } +#endif // Testing get/set functions void tst_QTextFormat::getSetCheck() |