diff options
Diffstat (limited to 'tests/auto/gui/text/qabstracttextdocumentlayout/tst_qabstracttextdocumentlayout.cpp')
-rw-r--r-- | tests/auto/gui/text/qabstracttextdocumentlayout/tst_qabstracttextdocumentlayout.cpp | 39 |
1 files changed, 9 insertions, 30 deletions
diff --git a/tests/auto/gui/text/qabstracttextdocumentlayout/tst_qabstracttextdocumentlayout.cpp b/tests/auto/gui/text/qabstracttextdocumentlayout/tst_qabstracttextdocumentlayout.cpp index cdd2b9cd44..3d0fab4603 100644 --- a/tests/auto/gui/text/qabstracttextdocumentlayout/tst_qabstracttextdocumentlayout.cpp +++ b/tests/auto/gui/text/qabstracttextdocumentlayout/tst_qabstracttextdocumentlayout.cpp @@ -1,30 +1,5 @@ -/**************************************************************************** -** -** 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> @@ -47,9 +22,11 @@ public: private slots: void getSetCheck(); void maximumBlockCount(); +#ifndef QT_NO_TEXTHTMLPARSER void anchorAt(); void imageAt(); void formatAt(); +#endif }; tst_QAbstractTextDocumentLayout::tst_QAbstractTextDocumentLayout() @@ -144,6 +121,7 @@ void tst_QAbstractTextDocumentLayout::maximumBlockCount() QCOMPARE(layout.blockCount, 10); } +#ifndef QT_NO_TEXTHTMLPARSER void tst_QAbstractTextDocumentLayout::anchorAt() { QTextDocument doc; @@ -151,7 +129,7 @@ void tst_QAbstractTextDocumentLayout::anchorAt() QAbstractTextDocumentLayout *documentLayout = doc.documentLayout(); QTextBlock firstBlock = doc.begin(); QTextLayout *layout = firstBlock.layout(); - layout->setPreeditArea(doc.toPlainText().length(), "xxx"); + layout->setPreeditArea(doc.toPlainText().size(), "xxx"); doc.setPageSize(QSizeF(1000, 1000)); QFontMetrics metrics(layout->font()); @@ -181,7 +159,7 @@ void tst_QAbstractTextDocumentLayout::imageAt() QAbstractTextDocumentLayout *documentLayout = doc.documentLayout(); QTextBlock firstBlock = doc.begin(); QTextLayout *layout = firstBlock.layout(); - layout->setPreeditArea(doc.toPlainText().length(), "xxx"); + layout->setPreeditArea(doc.toPlainText().size(), "xxx"); doc.setPageSize(QSizeF(1000, 1000)); QFontMetrics metrics(layout->font()); @@ -206,7 +184,7 @@ void tst_QAbstractTextDocumentLayout::formatAt() QAbstractTextDocumentLayout *documentLayout = doc.documentLayout(); QTextBlock firstBlock = doc.begin(); QTextLayout *layout = firstBlock.layout(); - layout->setPreeditArea(doc.toPlainText().length(), "xxx"); + layout->setPreeditArea(doc.toPlainText().size(), "xxx"); doc.setPageSize(QSizeF(1000, 1000)); QFontMetrics metrics(layout->font()); @@ -229,6 +207,7 @@ void tst_QAbstractTextDocumentLayout::formatAt() QVERIFY(!format.toCharFormat().fontItalic()); QVERIFY(!format.isImageFormat()); } +#endif QTEST_MAIN(tst_QAbstractTextDocumentLayout) #include "tst_qabstracttextdocumentlayout.moc" |