From 3e75c2965c96fa014ab74121e84d623fd04a27f7 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Mon, 10 Jun 2019 00:09:10 +0200 Subject: Remove QLatin1Literal usages That's an undocumented Qt 4/3/2 remnant, start remove usages. Fix incorrect include header in qclass_lib_map.h as a drive-by. Change-Id: I939be2621bc03e5c75f7e3f152546d3af6d37b91 Reviewed-by: Marc Mutz Reviewed-by: Thiago Macieira --- .../kernel/qmetaproperty/tst_qmetaproperty.cpp | 6 ++--- tests/auto/corelib/kernel/qobject/tst_qobject.cpp | 2 +- tests/auto/gui/painting/qbrush/tst_qbrush.cpp | 6 ++--- .../widgets/qdatetimeedit/tst_qdatetimeedit.cpp | 30 +++++++++++----------- .../widgets/qdoublespinbox/tst_qdoublespinbox.cpp | 18 ++++++------- .../auto/widgets/widgets/qspinbox/tst_qspinbox.cpp | 18 ++++++------- .../corelib/tools/qstringbuilder/main.cpp | 2 +- 7 files changed, 41 insertions(+), 41 deletions(-) (limited to 'tests') diff --git a/tests/auto/corelib/kernel/qmetaproperty/tst_qmetaproperty.cpp b/tests/auto/corelib/kernel/qmetaproperty/tst_qmetaproperty.cpp index 681a5d0146..cc67fc7884 100644 --- a/tests/auto/corelib/kernel/qmetaproperty/tst_qmetaproperty.cpp +++ b/tests/auto/corelib/kernel/qmetaproperty/tst_qmetaproperty.cpp @@ -130,7 +130,7 @@ public: QString m_value; void setValue(const QString &value) { m_value = value; } QString getValue() { return m_value; } - void resetValue() { m_value = QLatin1Literal("reset"); } + void resetValue() { m_value = QLatin1String("reset"); } }; void tst_QMetaProperty::gadget() @@ -140,7 +140,7 @@ void tst_QMetaProperty::gadget() QVERIFY(valueProp.isValid()); { MyGadget g; - QString hello = QLatin1Literal("hello"); + QString hello = QLatin1String("hello"); QVERIFY(valueProp.writeOnGadget(&g, hello)); QCOMPARE(g.m_value, QLatin1String("hello")); QCOMPARE(valueProp.readOnGadget(&g), QVariant(hello)); @@ -242,7 +242,7 @@ void tst_QMetaProperty::conversion() QCOMPARE(custom.str, QString()); // or reset resetable QVERIFY(value7P.write(this, QVariant())); - QCOMPARE(value7, QLatin1Literal("reset")); + QCOMPARE(value7, QLatin1String("reset")); } QTEST_MAIN(tst_QMetaProperty) diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp index f1c4effa95..7c9d8a476a 100644 --- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp +++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp @@ -5979,7 +5979,7 @@ void ConnectToPrivateSlot::test(SenderObject* obj1) { obj1->signal1(); QCOMPARE(d->receivedCount, 1); QCOMPARE(d->receivedValue, QVariant()); - obj1->signal7(666, QLatin1Literal("_")); + obj1->signal7(666, QLatin1String("_")); QCOMPARE(d->receivedCount, 2); QCOMPARE(d->receivedValue, QVariant(666)); QVERIFY(QObjectPrivate::connect(obj1, &SenderObject::signal2, d, &ConnectToPrivateSlotPrivate::thisIsAPrivateSlot, Qt::UniqueConnection)); diff --git a/tests/auto/gui/painting/qbrush/tst_qbrush.cpp b/tests/auto/gui/painting/qbrush/tst_qbrush.cpp index ce6ce15767..f35d4f330b 100644 --- a/tests/auto/gui/painting/qbrush/tst_qbrush.cpp +++ b/tests/auto/gui/painting/qbrush/tst_qbrush.cpp @@ -338,9 +338,9 @@ void tst_QBrush::gradientPresets() QCOMPARE(lg->finalStop(), QPointF(1, 0)); QCOMPARE(lg->stops().size(), 3); - QCOMPARE(lg->stops().at(0), QGradientStop(0, QColor(QLatin1Literal("#ff9a9e")))); - QCOMPARE(lg->stops().at(1), QGradientStop(0.99, QColor(QLatin1Literal("#fad0c4")))); - QCOMPARE(lg->stops().at(2), QGradientStop(1, QColor(QLatin1Literal("#fad0c4")))); + QCOMPARE(lg->stops().at(0), QGradientStop(0, QColor(QLatin1String("#ff9a9e")))); + QCOMPARE(lg->stops().at(1), QGradientStop(0.99, QColor(QLatin1String("#fad0c4")))); + QCOMPARE(lg->stops().at(2), QGradientStop(1, QColor(QLatin1String("#fad0c4")))); QGradient invalidPreset(QGradient::Preset(-1)); diff --git a/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp b/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp index b5ef454b14..c6f6900def 100644 --- a/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp +++ b/tests/auto/widgets/widgets/qdatetimeedit/tst_qdatetimeedit.cpp @@ -307,19 +307,19 @@ static QLatin1String modifierToName(Qt::KeyboardModifier modifier) { switch (modifier) { case Qt::NoModifier: - return QLatin1Literal("No"); + return QLatin1String("No"); break; case Qt::ControlModifier: - return QLatin1Literal("Ctrl"); + return QLatin1String("Ctrl"); break; case Qt::ShiftModifier: - return QLatin1Literal("Shift"); + return QLatin1String("Shift"); break; case Qt::AltModifier: - return QLatin1Literal("Alt"); + return QLatin1String("Alt"); break; case Qt::MetaModifier: - return QLatin1Literal("Meta"); + return QLatin1String("Meta"); break; default: qFatal("Unexpected keyboard modifier"); @@ -331,17 +331,17 @@ static QLatin1String sectionToName(const QDateTimeEdit::Section section) { switch (section) { case QDateTimeEdit::SecondSection: - return QLatin1Literal("Second"); + return QLatin1String("Second"); case QDateTimeEdit::MinuteSection: - return QLatin1Literal("Minute"); + return QLatin1String("Minute"); case QDateTimeEdit::HourSection: - return QLatin1Literal("Hours"); + return QLatin1String("Hours"); case QDateTimeEdit::DaySection: - return QLatin1Literal("Day"); + return QLatin1String("Day"); case QDateTimeEdit::MonthSection: - return QLatin1Literal("Month"); + return QLatin1String("Month"); case QDateTimeEdit::YearSection: - return QLatin1Literal("Year"); + return QLatin1String("Year"); default: qFatal("Unexpected section"); return QLatin1String(); @@ -3217,16 +3217,16 @@ void tst_QDateTimeEdit::wheelEvent_data() QLatin1String sourceName; switch (source) { case Qt::MouseEventNotSynthesized: - sourceName = QLatin1Literal("NotSynthesized"); + sourceName = QLatin1String("NotSynthesized"); break; case Qt::MouseEventSynthesizedBySystem: - sourceName = QLatin1Literal("SynthesizedBySystem"); + sourceName = QLatin1String("SynthesizedBySystem"); break; case Qt::MouseEventSynthesizedByQt: - sourceName = QLatin1Literal("SynthesizedByQt"); + sourceName = QLatin1String("SynthesizedByQt"); break; case Qt::MouseEventSynthesizedByApplication: - sourceName = QLatin1Literal("SynthesizedByApplication"); + sourceName = QLatin1String("SynthesizedByApplication"); break; default: qFatal("Unexpected wheel event source"); diff --git a/tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp b/tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp index 954ee6471d..a20b5568da 100644 --- a/tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp +++ b/tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp @@ -221,19 +221,19 @@ static QLatin1String modifierToName(Qt::KeyboardModifier modifier) { switch (modifier) { case Qt::NoModifier: - return QLatin1Literal("No"); + return QLatin1String("No"); break; case Qt::ControlModifier: - return QLatin1Literal("Ctrl"); + return QLatin1String("Ctrl"); break; case Qt::ShiftModifier: - return QLatin1Literal("Shift"); + return QLatin1String("Shift"); break; case Qt::AltModifier: - return QLatin1Literal("Alt"); + return QLatin1String("Alt"); break; case Qt::MetaModifier: - return QLatin1Literal("Meta"); + return QLatin1String("Meta"); break; default: qFatal("Unexpected keyboard modifier"); @@ -1448,16 +1448,16 @@ void tst_QDoubleSpinBox::wheelEvents_data() QLatin1String sourceName; switch (source) { case Qt::MouseEventNotSynthesized: - sourceName = QLatin1Literal("NotSynthesized"); + sourceName = QLatin1String("NotSynthesized"); break; case Qt::MouseEventSynthesizedBySystem: - sourceName = QLatin1Literal("SynthesizedBySystem"); + sourceName = QLatin1String("SynthesizedBySystem"); break; case Qt::MouseEventSynthesizedByQt: - sourceName = QLatin1Literal("SynthesizedByQt"); + sourceName = QLatin1String("SynthesizedByQt"); break; case Qt::MouseEventSynthesizedByApplication: - sourceName = QLatin1Literal("SynthesizedByApplication"); + sourceName = QLatin1String("SynthesizedByApplication"); break; default: qFatal("Unexpected wheel event source"); diff --git a/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp b/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp index 7bce23af26..3dd29b0214 100644 --- a/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp +++ b/tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp @@ -222,19 +222,19 @@ static QLatin1String modifierToName(Qt::KeyboardModifier modifier) { switch (modifier) { case Qt::NoModifier: - return QLatin1Literal("No"); + return QLatin1String("No"); break; case Qt::ControlModifier: - return QLatin1Literal("Ctrl"); + return QLatin1String("Ctrl"); break; case Qt::ShiftModifier: - return QLatin1Literal("Shift"); + return QLatin1String("Shift"); break; case Qt::AltModifier: - return QLatin1Literal("Alt"); + return QLatin1String("Alt"); break; case Qt::MetaModifier: - return QLatin1Literal("Meta"); + return QLatin1String("Meta"); break; default: qFatal("Unexpected keyboard modifier"); @@ -1402,16 +1402,16 @@ void tst_QSpinBox::wheelEvents_data() QLatin1String sourceName; switch (source) { case Qt::MouseEventNotSynthesized: - sourceName = QLatin1Literal("NotSynthesized"); + sourceName = QLatin1String("NotSynthesized"); break; case Qt::MouseEventSynthesizedBySystem: - sourceName = QLatin1Literal("SynthesizedBySystem"); + sourceName = QLatin1String("SynthesizedBySystem"); break; case Qt::MouseEventSynthesizedByQt: - sourceName = QLatin1Literal("SynthesizedByQt"); + sourceName = QLatin1String("SynthesizedByQt"); break; case Qt::MouseEventSynthesizedByApplication: - sourceName = QLatin1Literal("SynthesizedByApplication"); + sourceName = QLatin1String("SynthesizedByApplication"); break; default: qFatal("Unexpected wheel event source"); diff --git a/tests/benchmarks/corelib/tools/qstringbuilder/main.cpp b/tests/benchmarks/corelib/tools/qstringbuilder/main.cpp index d0dfe3b1a7..0de6d33846 100644 --- a/tests/benchmarks/corelib/tools/qstringbuilder/main.cpp +++ b/tests/benchmarks/corelib/tools/qstringbuilder/main.cpp @@ -401,7 +401,7 @@ private slots: } private: - const QLatin1Literal l1literal; + const QLatin1String l1literal; const QLatin1String l1string; const QByteArray ba; const QString string; -- cgit v1.2.3