summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/text/qstatictext
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/gui/text/qstatictext')
-rw-r--r--tests/auto/gui/text/qstatictext/CMakeLists.txt10
-rw-r--r--tests/auto/gui/text/qstatictext/tst_qstatictext.cpp61
2 files changed, 8 insertions, 63 deletions
diff --git a/tests/auto/gui/text/qstatictext/CMakeLists.txt b/tests/auto/gui/text/qstatictext/CMakeLists.txt
index 218741256f..bdad2609fe 100644
--- a/tests/auto/gui/text/qstatictext/CMakeLists.txt
+++ b/tests/auto/gui/text/qstatictext/CMakeLists.txt
@@ -1,12 +1,16 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
-# Generated from qstatictext.pro.
-
#####################################################################
## tst_qstatictext Test:
#####################################################################
+if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+ cmake_minimum_required(VERSION 3.16)
+ project(tst_qstatictext LANGUAGES CXX)
+ find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST)
+endif()
+
qt_internal_add_test(tst_qstatictext
SOURCES
tst_qstatictext.cpp
@@ -17,7 +21,7 @@ qt_internal_add_test(tst_qstatictext
## Scopes:
#####################################################################
-qt_internal_extend_target(tst_qstatictext CONDITION QT_FEATURE_private_tests
+qt_internal_extend_target(tst_qstatictext CONDITION QT_FEATURE_developer_build
LIBRARIES
Qt::CorePrivate
Qt::GuiPrivate
diff --git a/tests/auto/gui/text/qstatictext/tst_qstatictext.cpp b/tests/auto/gui/text/qstatictext/tst_qstatictext.cpp
index e6e16374d3..add2303199 100644
--- a/tests/auto/gui/text/qstatictext/tst_qstatictext.cpp
+++ b/tests/auto/gui/text/qstatictext/tst_qstatictext.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>
#include <QtCore/QSet>
@@ -50,10 +50,6 @@ private slots:
void rotatedPainter();
void scaledPainter();
void projectedPainter();
-#if 0
- void rotatedScaledAndTranslatedPainter_data();
- void rotatedScaledAndTranslatedPainter();
-#endif
void transformationChanged();
void plainTextVsRichText();
@@ -501,61 +497,6 @@ void tst_QStaticText::projectedPainter()
QCOMPARE(imageDrawStaticText, imageDrawText);
}
-#if 0
-void tst_QStaticText::rotatedScaledAndTranslatedPainter_data()
-{
- QTest::addColumn<qreal>("offset");
-
- for (int i=0; i<100; ++i) {
- qreal offset = 300 + i / 100.;
- QTest::newRow(QByteArray::number(offset).constData()) << offset;
- }
-}
-
-void tst_QStaticText::rotatedScaledAndTranslatedPainter()
-{
- QFETCH(qreal, offset);
-
- QPixmap imageDrawText(1000, 1000);
- imageDrawText.fill(Qt::white);
- {
- QPainter p(&imageDrawText);
- p.translate(offset, 0);
- p.rotate(45.0);
- p.scale(2.0, 2.0);
- p.translate(100, 200);
-
- p.drawText(11, 12, "Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
- }
-
- QPixmap imageDrawStaticText(1000, 1000);
- imageDrawStaticText.fill(Qt::white);
- {
- QPainter p(&imageDrawStaticText);
- p.translate(offset, 0);
- p.rotate(45.0);
- p.scale(2.0, 2.0);
- p.translate(100, 200);
-
- QStaticText text("Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
- text.setTextFormat(Qt::PlainText);
-
- p.drawStaticText(QPointF(11, 12 - QFontMetricsF(p.font()).ascent()), text);
- }
-
-#if defined(DEBUG_SAVE_IMAGE)
- imageDrawText.save("rotatedScaledAndPainter_imageDrawText.png");
- imageDrawStaticText.save("rotatedScaledAndPainter_imageDrawStaticText.png");
-#endif
-
- QVERIFY(imageDrawText.toImage() != m_whiteSquare);
-
- if (!supportsTransformations())
- QEXPECT_FAIL("", "Graphics system does not support transformed text on this platform", Abort);
- QCOMPARE(imageDrawStaticText, imageDrawText);
-}
-#endif
-
void tst_QStaticText::transformationChanged()
{
QPixmap imageDrawText(1000, 1000);