From 87d57d19941fba4a921020480ca5761f23536c93 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 21 Feb 2014 15:15:29 +0100 Subject: Fix users of QTextLayout::additionalFormats to use the new API QTextLayout::additionalFormats setters and getters using QList have been deprecated; port to the QVector versions. Moved op== definition for FormatRange needed in tst_qsyntaxhighlighter.cpp to a friend declaration in FormatRange itself, because MSVC 2008 doesn't find it otherwise. Change-Id: Ibab6589df057f02377d895079b56395859e3401e Reviewed-by: Konstantin Ritt --- tests/benchmarks/gui/text/qtext/main.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tests/benchmarks') diff --git a/tests/benchmarks/gui/text/qtext/main.cpp b/tests/benchmarks/gui/text/qtext/main.cpp index 224d9619ec..f20b3f6cce 100644 --- a/tests/benchmarks/gui/text/qtext/main.cpp +++ b/tests/benchmarks/gui/text/qtext/main.cpp @@ -42,7 +42,7 @@ #include #include -Q_DECLARE_METATYPE(QList) +Q_DECLARE_METATYPE(QVector) class tst_QText: public QObject { @@ -324,13 +324,13 @@ void tst_QText::layout() void tst_QText::formattedLayout_data() { QTest::addColumn("text"); - QTest::addColumn >("ranges"); + QTest::addColumn >("ranges"); QTextCharFormat format; format.setForeground(QColor("steelblue")); { - QList ranges; + QVector ranges; QTextLayout::FormatRange formatRange; formatRange.format = format; @@ -341,7 +341,7 @@ void tst_QText::formattedLayout_data() QTest::newRow("short-single") << m_shortLorem << ranges; } { - QList ranges; + QVector ranges; QString text = m_lorem.repeated(100); const int width = 1; @@ -360,15 +360,15 @@ void tst_QText::formattedLayout_data() void tst_QText::formattedLayout() { QFETCH(QString, text); - QFETCH(QList, ranges); + QFETCH(QVector, ranges); QTextLayout layout(text); - layout.setAdditionalFormats(ranges); + layout.setFormats(ranges); setupTextLayout(&layout); QBENCHMARK { QTextLayout layout(text); - layout.setAdditionalFormats(ranges); + layout.setFormats(ranges); setupTextLayout(&layout); } } -- cgit v1.2.3