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 <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Giuseppe D'Angelo 2019-06-10 00:09:10 +02:00 committed by Marc Mutz
parent d7093487a3
commit 3e75c2965c
13 changed files with 65 additions and 65 deletions

View File

@ -1467,7 +1467,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
<< "\t\t\t" << writeSettings("name", "Qt Test") << ";\n" << "\t\t\t" << writeSettings("name", "Qt Test") << ";\n"
<< "\t\t};\n"; << "\t\t};\n";
QLatin1Literal testTargetID("TestTargetID"); QLatin1String testTargetID("TestTargetID");
project->values(ProKey("QMAKE_PBX_TARGET_ATTRIBUTES_" + testTargetKey + "_" + testTargetID)).append(keyFor(pbx_dir + "QMAKE_PBX_TARGET")); project->values(ProKey("QMAKE_PBX_TARGET_ATTRIBUTES_" + testTargetKey + "_" + testTargetID)).append(keyFor(pbx_dir + "QMAKE_PBX_TARGET"));
project->values(ProKey("QMAKE_PBX_TARGET_ATTRIBUTES_" + testTargetKey)).append(ProKey(testTargetID)); project->values(ProKey("QMAKE_PBX_TARGET_ATTRIBUTES_" + testTargetKey)).append(ProKey(testTargetID));
} }

View File

@ -1385,16 +1385,16 @@ QGradient::QGradient(Preset preset)
setCoordinateMode(ObjectMode); setCoordinateMode(ObjectMode);
setSpread(PadSpread); setSpread(PadSpread);
const QJsonValue start = presetData[QLatin1Literal("start")]; const QJsonValue start = presetData[QLatin1String("start")];
const QJsonValue end = presetData[QLatin1Literal("end")]; const QJsonValue end = presetData[QLatin1String("end")];
m_data.linear.x1 = start[QLatin1Literal("x")].toDouble(); m_data.linear.x1 = start[QLatin1String("x")].toDouble();
m_data.linear.y1 = start[QLatin1Literal("y")].toDouble(); m_data.linear.y1 = start[QLatin1String("y")].toDouble();
m_data.linear.x2 = end[QLatin1Literal("x")].toDouble(); m_data.linear.x2 = end[QLatin1String("x")].toDouble();
m_data.linear.y2 = end[QLatin1Literal("y")].toDouble(); m_data.linear.y2 = end[QLatin1String("y")].toDouble();
for (const QJsonValue &stop : presetData[QLatin1String("stops")].toArray()) { for (const QJsonValue &stop : presetData[QLatin1String("stops")].toArray()) {
setColorAt(stop[QLatin1Literal("position")].toDouble(), setColorAt(stop[QLatin1String("position")].toDouble(),
QColor(QRgb(stop[QLatin1Literal("color")].toInt()))); QColor(QRgb(stop[QLatin1String("color")].toInt())));
} }
cachedPresets.insert(preset, *this); cachedPresets.insert(preset, *this);

View File

@ -118,7 +118,7 @@ QSurfaceFormat QIOSContext::format() const
return m_format; return m_format;
} }
#define QT_IOS_GL_STATUS_CASE(val) case val: return QLatin1Literal(#val) #define QT_IOS_GL_STATUS_CASE(val) case val: return QLatin1String(#val)
static QString fboStatusString(GLenum status) static QString fboStatusString(GLenum status)
{ {

View File

@ -455,7 +455,7 @@ static const uchar base_dither_matrix[DITHER_SIZE][DITHER_SIZE] = {
static QPixmap qt_patternForAlpha(uchar alpha, int screen) static QPixmap qt_patternForAlpha(uchar alpha, int screen)
{ {
QPixmap pm; QPixmap pm;
QString key = QLatin1Literal("$qt-alpha-brush$") QString key = QLatin1String("$qt-alpha-brush$")
% HexString<uchar>(alpha) % HexString<uchar>(alpha)
% HexString<int>(screen); % HexString<int>(screen);

View File

@ -154,10 +154,10 @@ void QTapTestLogger::addIncident(IncidentTypes type, const char *description,
// This is fragile, but unfortunately testlib doesn't plumb // This is fragile, but unfortunately testlib doesn't plumb
// the expected and actual values to the loggers (yet). // the expected and actual values to the loggers (yet).
static QRegularExpression verifyRegex( static QRegularExpression verifyRegex(
QLatin1Literal("^'(?<actualexpression>.*)' returned (?<actual>\\w+).+\\((?<message>.*)\\)$")); QLatin1String("^'(?<actualexpression>.*)' returned (?<actual>\\w+).+\\((?<message>.*)\\)$"));
static QRegularExpression comparRegex( static QRegularExpression comparRegex(
QLatin1Literal("^(?<message>.*)\n" QLatin1String("^(?<message>.*)\n"
"\\s*Actual\\s+\\((?<actualexpression>.*)\\)\\s*: (?<actual>.*)\n" "\\s*Actual\\s+\\((?<actualexpression>.*)\\)\\s*: (?<actual>.*)\n"
"\\s*Expected\\s+\\((?<expectedexpresssion>.*)\\)\\s*: (?<expected>.*)$")); "\\s*Expected\\s+\\((?<expectedexpresssion>.*)\\)\\s*: (?<expected>.*)$"));
@ -168,22 +168,22 @@ void QTapTestLogger::addIncident(IncidentTypes type, const char *description,
if (match.hasMatch()) { if (match.hasMatch()) {
bool isVerify = match.regularExpression() == verifyRegex; bool isVerify = match.regularExpression() == verifyRegex;
QString message = match.captured(QLatin1Literal("message")); QString message = match.captured(QLatin1String("message"));
QString expected; QString expected;
QString actual; QString actual;
if (isVerify) { if (isVerify) {
QString expression = QLatin1Literal(" (") QString expression = QLatin1String(" (")
% match.captured(QLatin1Literal("actualexpression")) % QLatin1Char(')') ; % match.captured(QLatin1String("actualexpression")) % QLatin1Char(')') ;
actual = match.captured(QLatin1Literal("actual")).toLower() % expression; actual = match.captured(QLatin1String("actual")).toLower() % expression;
expected = (actual.startsWith(QLatin1Literal("true")) ? QLatin1Literal("false") : QLatin1Literal("true")) % expression; expected = (actual.startsWith(QLatin1String("true")) ? QLatin1String("false") : QLatin1String("true")) % expression;
if (message.isEmpty()) if (message.isEmpty())
message = QLatin1Literal("Verification failed"); message = QLatin1String("Verification failed");
} else { } else {
expected = match.captured(QLatin1Literal("expected")) expected = match.captured(QLatin1String("expected"))
% QLatin1Literal(" (") % match.captured(QLatin1Literal("expectedexpresssion")) % QLatin1Char(')'); % QLatin1String(" (") % match.captured(QLatin1String("expectedexpresssion")) % QLatin1Char(')');
actual = match.captured(QLatin1Literal("actual")) actual = match.captured(QLatin1String("actual"))
% QLatin1Literal(" (") % match.captured(QLatin1Literal("actualexpression")) % QLatin1Char(')'); % QLatin1String(" (") % match.captured(QLatin1String("actualexpression")) % QLatin1Char(')');
} }
QTestCharBuffer diagnosticsYamlish; QTestCharBuffer diagnosticsYamlish;

View File

@ -249,7 +249,7 @@ QT_CLASS_LIB(QLatin1String, QtCore, qstring.h)
QT_CLASS_LIB(QCharRef, QtCore, qstring.h) QT_CLASS_LIB(QCharRef, QtCore, qstring.h)
QT_CLASS_LIB(QConstString, QtCore, qstring.h) QT_CLASS_LIB(QConstString, QtCore, qstring.h)
QT_CLASS_LIB(QStringRef, QtCore, qstring.h) QT_CLASS_LIB(QStringRef, QtCore, qstring.h)
QT_CLASS_LIB(QLatin1Literal, QtCore, qstringbuilder.h) QT_CLASS_LIB(QLatin1Literal, QtCore, qstring.h)
QT_CLASS_LIB(QAbstractConcatenable, QtCore, qstringbuilder.h) QT_CLASS_LIB(QAbstractConcatenable, QtCore, qstringbuilder.h)
QT_CLASS_LIB(QConcatenable, QtCore, qstringbuilder.h) QT_CLASS_LIB(QConcatenable, QtCore, qstringbuilder.h)
QT_CLASS_LIB(QStringBuilder, QtCore, qstringbuilder.h) QT_CLASS_LIB(QStringBuilder, QtCore, qstringbuilder.h)

View File

@ -130,7 +130,7 @@ public:
QString m_value; QString m_value;
void setValue(const QString &value) { m_value = value; } void setValue(const QString &value) { m_value = value; }
QString getValue() { return m_value; } QString getValue() { return m_value; }
void resetValue() { m_value = QLatin1Literal("reset"); } void resetValue() { m_value = QLatin1String("reset"); }
}; };
void tst_QMetaProperty::gadget() void tst_QMetaProperty::gadget()
@ -140,7 +140,7 @@ void tst_QMetaProperty::gadget()
QVERIFY(valueProp.isValid()); QVERIFY(valueProp.isValid());
{ {
MyGadget g; MyGadget g;
QString hello = QLatin1Literal("hello"); QString hello = QLatin1String("hello");
QVERIFY(valueProp.writeOnGadget(&g, hello)); QVERIFY(valueProp.writeOnGadget(&g, hello));
QCOMPARE(g.m_value, QLatin1String("hello")); QCOMPARE(g.m_value, QLatin1String("hello"));
QCOMPARE(valueProp.readOnGadget(&g), QVariant(hello)); QCOMPARE(valueProp.readOnGadget(&g), QVariant(hello));
@ -242,7 +242,7 @@ void tst_QMetaProperty::conversion()
QCOMPARE(custom.str, QString()); QCOMPARE(custom.str, QString());
// or reset resetable // or reset resetable
QVERIFY(value7P.write(this, QVariant())); QVERIFY(value7P.write(this, QVariant()));
QCOMPARE(value7, QLatin1Literal("reset")); QCOMPARE(value7, QLatin1String("reset"));
} }
QTEST_MAIN(tst_QMetaProperty) QTEST_MAIN(tst_QMetaProperty)

View File

@ -5979,7 +5979,7 @@ void ConnectToPrivateSlot::test(SenderObject* obj1) {
obj1->signal1(); obj1->signal1();
QCOMPARE(d->receivedCount, 1); QCOMPARE(d->receivedCount, 1);
QCOMPARE(d->receivedValue, QVariant()); QCOMPARE(d->receivedValue, QVariant());
obj1->signal7(666, QLatin1Literal("_")); obj1->signal7(666, QLatin1String("_"));
QCOMPARE(d->receivedCount, 2); QCOMPARE(d->receivedCount, 2);
QCOMPARE(d->receivedValue, QVariant(666)); QCOMPARE(d->receivedValue, QVariant(666));
QVERIFY(QObjectPrivate::connect(obj1, &SenderObject::signal2, d, &ConnectToPrivateSlotPrivate::thisIsAPrivateSlot, Qt::UniqueConnection)); QVERIFY(QObjectPrivate::connect(obj1, &SenderObject::signal2, d, &ConnectToPrivateSlotPrivate::thisIsAPrivateSlot, Qt::UniqueConnection));

View File

@ -338,9 +338,9 @@ void tst_QBrush::gradientPresets()
QCOMPARE(lg->finalStop(), QPointF(1, 0)); QCOMPARE(lg->finalStop(), QPointF(1, 0));
QCOMPARE(lg->stops().size(), 3); QCOMPARE(lg->stops().size(), 3);
QCOMPARE(lg->stops().at(0), QGradientStop(0, QColor(QLatin1Literal("#ff9a9e")))); QCOMPARE(lg->stops().at(0), QGradientStop(0, QColor(QLatin1String("#ff9a9e"))));
QCOMPARE(lg->stops().at(1), QGradientStop(0.99, QColor(QLatin1Literal("#fad0c4")))); QCOMPARE(lg->stops().at(1), QGradientStop(0.99, QColor(QLatin1String("#fad0c4"))));
QCOMPARE(lg->stops().at(2), QGradientStop(1, QColor(QLatin1Literal("#fad0c4")))); QCOMPARE(lg->stops().at(2), QGradientStop(1, QColor(QLatin1String("#fad0c4"))));
QGradient invalidPreset(QGradient::Preset(-1)); QGradient invalidPreset(QGradient::Preset(-1));

View File

@ -307,19 +307,19 @@ static QLatin1String modifierToName(Qt::KeyboardModifier modifier)
{ {
switch (modifier) { switch (modifier) {
case Qt::NoModifier: case Qt::NoModifier:
return QLatin1Literal("No"); return QLatin1String("No");
break; break;
case Qt::ControlModifier: case Qt::ControlModifier:
return QLatin1Literal("Ctrl"); return QLatin1String("Ctrl");
break; break;
case Qt::ShiftModifier: case Qt::ShiftModifier:
return QLatin1Literal("Shift"); return QLatin1String("Shift");
break; break;
case Qt::AltModifier: case Qt::AltModifier:
return QLatin1Literal("Alt"); return QLatin1String("Alt");
break; break;
case Qt::MetaModifier: case Qt::MetaModifier:
return QLatin1Literal("Meta"); return QLatin1String("Meta");
break; break;
default: default:
qFatal("Unexpected keyboard modifier"); qFatal("Unexpected keyboard modifier");
@ -331,17 +331,17 @@ static QLatin1String sectionToName(const QDateTimeEdit::Section section)
{ {
switch (section) { switch (section) {
case QDateTimeEdit::SecondSection: case QDateTimeEdit::SecondSection:
return QLatin1Literal("Second"); return QLatin1String("Second");
case QDateTimeEdit::MinuteSection: case QDateTimeEdit::MinuteSection:
return QLatin1Literal("Minute"); return QLatin1String("Minute");
case QDateTimeEdit::HourSection: case QDateTimeEdit::HourSection:
return QLatin1Literal("Hours"); return QLatin1String("Hours");
case QDateTimeEdit::DaySection: case QDateTimeEdit::DaySection:
return QLatin1Literal("Day"); return QLatin1String("Day");
case QDateTimeEdit::MonthSection: case QDateTimeEdit::MonthSection:
return QLatin1Literal("Month"); return QLatin1String("Month");
case QDateTimeEdit::YearSection: case QDateTimeEdit::YearSection:
return QLatin1Literal("Year"); return QLatin1String("Year");
default: default:
qFatal("Unexpected section"); qFatal("Unexpected section");
return QLatin1String(); return QLatin1String();
@ -3217,16 +3217,16 @@ void tst_QDateTimeEdit::wheelEvent_data()
QLatin1String sourceName; QLatin1String sourceName;
switch (source) { switch (source) {
case Qt::MouseEventNotSynthesized: case Qt::MouseEventNotSynthesized:
sourceName = QLatin1Literal("NotSynthesized"); sourceName = QLatin1String("NotSynthesized");
break; break;
case Qt::MouseEventSynthesizedBySystem: case Qt::MouseEventSynthesizedBySystem:
sourceName = QLatin1Literal("SynthesizedBySystem"); sourceName = QLatin1String("SynthesizedBySystem");
break; break;
case Qt::MouseEventSynthesizedByQt: case Qt::MouseEventSynthesizedByQt:
sourceName = QLatin1Literal("SynthesizedByQt"); sourceName = QLatin1String("SynthesizedByQt");
break; break;
case Qt::MouseEventSynthesizedByApplication: case Qt::MouseEventSynthesizedByApplication:
sourceName = QLatin1Literal("SynthesizedByApplication"); sourceName = QLatin1String("SynthesizedByApplication");
break; break;
default: default:
qFatal("Unexpected wheel event source"); qFatal("Unexpected wheel event source");

View File

@ -221,19 +221,19 @@ static QLatin1String modifierToName(Qt::KeyboardModifier modifier)
{ {
switch (modifier) { switch (modifier) {
case Qt::NoModifier: case Qt::NoModifier:
return QLatin1Literal("No"); return QLatin1String("No");
break; break;
case Qt::ControlModifier: case Qt::ControlModifier:
return QLatin1Literal("Ctrl"); return QLatin1String("Ctrl");
break; break;
case Qt::ShiftModifier: case Qt::ShiftModifier:
return QLatin1Literal("Shift"); return QLatin1String("Shift");
break; break;
case Qt::AltModifier: case Qt::AltModifier:
return QLatin1Literal("Alt"); return QLatin1String("Alt");
break; break;
case Qt::MetaModifier: case Qt::MetaModifier:
return QLatin1Literal("Meta"); return QLatin1String("Meta");
break; break;
default: default:
qFatal("Unexpected keyboard modifier"); qFatal("Unexpected keyboard modifier");
@ -1448,16 +1448,16 @@ void tst_QDoubleSpinBox::wheelEvents_data()
QLatin1String sourceName; QLatin1String sourceName;
switch (source) { switch (source) {
case Qt::MouseEventNotSynthesized: case Qt::MouseEventNotSynthesized:
sourceName = QLatin1Literal("NotSynthesized"); sourceName = QLatin1String("NotSynthesized");
break; break;
case Qt::MouseEventSynthesizedBySystem: case Qt::MouseEventSynthesizedBySystem:
sourceName = QLatin1Literal("SynthesizedBySystem"); sourceName = QLatin1String("SynthesizedBySystem");
break; break;
case Qt::MouseEventSynthesizedByQt: case Qt::MouseEventSynthesizedByQt:
sourceName = QLatin1Literal("SynthesizedByQt"); sourceName = QLatin1String("SynthesizedByQt");
break; break;
case Qt::MouseEventSynthesizedByApplication: case Qt::MouseEventSynthesizedByApplication:
sourceName = QLatin1Literal("SynthesizedByApplication"); sourceName = QLatin1String("SynthesizedByApplication");
break; break;
default: default:
qFatal("Unexpected wheel event source"); qFatal("Unexpected wheel event source");

View File

@ -222,19 +222,19 @@ static QLatin1String modifierToName(Qt::KeyboardModifier modifier)
{ {
switch (modifier) { switch (modifier) {
case Qt::NoModifier: case Qt::NoModifier:
return QLatin1Literal("No"); return QLatin1String("No");
break; break;
case Qt::ControlModifier: case Qt::ControlModifier:
return QLatin1Literal("Ctrl"); return QLatin1String("Ctrl");
break; break;
case Qt::ShiftModifier: case Qt::ShiftModifier:
return QLatin1Literal("Shift"); return QLatin1String("Shift");
break; break;
case Qt::AltModifier: case Qt::AltModifier:
return QLatin1Literal("Alt"); return QLatin1String("Alt");
break; break;
case Qt::MetaModifier: case Qt::MetaModifier:
return QLatin1Literal("Meta"); return QLatin1String("Meta");
break; break;
default: default:
qFatal("Unexpected keyboard modifier"); qFatal("Unexpected keyboard modifier");
@ -1402,16 +1402,16 @@ void tst_QSpinBox::wheelEvents_data()
QLatin1String sourceName; QLatin1String sourceName;
switch (source) { switch (source) {
case Qt::MouseEventNotSynthesized: case Qt::MouseEventNotSynthesized:
sourceName = QLatin1Literal("NotSynthesized"); sourceName = QLatin1String("NotSynthesized");
break; break;
case Qt::MouseEventSynthesizedBySystem: case Qt::MouseEventSynthesizedBySystem:
sourceName = QLatin1Literal("SynthesizedBySystem"); sourceName = QLatin1String("SynthesizedBySystem");
break; break;
case Qt::MouseEventSynthesizedByQt: case Qt::MouseEventSynthesizedByQt:
sourceName = QLatin1Literal("SynthesizedByQt"); sourceName = QLatin1String("SynthesizedByQt");
break; break;
case Qt::MouseEventSynthesizedByApplication: case Qt::MouseEventSynthesizedByApplication:
sourceName = QLatin1Literal("SynthesizedByApplication"); sourceName = QLatin1String("SynthesizedByApplication");
break; break;
default: default:
qFatal("Unexpected wheel event source"); qFatal("Unexpected wheel event source");

View File

@ -401,7 +401,7 @@ private slots:
} }
private: private:
const QLatin1Literal l1literal; const QLatin1String l1literal;
const QLatin1String l1string; const QLatin1String l1string;
const QByteArray ba; const QByteArray ba;
const QString string; const QString string;