diff options
Diffstat (limited to 'tests/auto/gui/text/qstatictext/tst_qstatictext.cpp')
-rw-r--r-- | tests/auto/gui/text/qstatictext/tst_qstatictext.cpp | 93 |
1 files changed, 5 insertions, 88 deletions
diff --git a/tests/auto/gui/text/qstatictext/tst_qstatictext.cpp b/tests/auto/gui/text/qstatictext/tst_qstatictext.cpp index b55257533a..add2303199 100644 --- a/tests/auto/gui/text/qstatictext/tst_qstatictext.cpp +++ b/tests/auto/gui/text/qstatictext/tst_qstatictext.cpp @@ -1,32 +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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QTest> +#include <QtCore/QSet> #include <QtGui/QGuiApplication> #include <QtGui/QPainter> #include <QtGui/QImage> @@ -74,10 +50,6 @@ private slots: void rotatedPainter(); void scaledPainter(); void projectedPainter(); -#if 0 - void rotatedScaledAndTranslatedPainter_data(); - void rotatedScaledAndTranslatedPainter(); -#endif void transformationChanged(); void plainTextVsRichText(); @@ -261,8 +233,8 @@ void tst_QStaticText::compareToDrawText() #if defined(DEBUG_SAVE_IMAGE) imageDrawText.save("compareToDrawText_imageDrawText.png"); - imageDrawStaticText.save("compareToDrawText_imageDrawStaticPlainText.png"); - imageDrawStaticText.save("compareToDrawText_imageDrawStaticRichText.png"); + imageDrawStaticPlainText.save("compareToDrawText_imageDrawStaticPlainText.png"); + imageDrawStaticRichText.save("compareToDrawText_imageDrawStaticRichText.png"); #endif QVERIFY(imageDrawText.toImage() != m_whiteSquare); @@ -525,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); |