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};\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)).append(ProKey(testTargetID));
}

View File

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

View File

@ -118,7 +118,7 @@ QSurfaceFormat QIOSContext::format() const
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)
{

View File

@ -455,7 +455,7 @@ static const uchar base_dither_matrix[DITHER_SIZE][DITHER_SIZE] = {
static QPixmap qt_patternForAlpha(uchar alpha, int screen)
{
QPixmap pm;
QString key = QLatin1Literal("$qt-alpha-brush$")
QString key = QLatin1String("$qt-alpha-brush$")
% HexString<uchar>(alpha)
% 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
// the expected and actual values to the loggers (yet).
static QRegularExpression verifyRegex(
QLatin1Literal("^'(?<actualexpression>.*)' returned (?<actual>\\w+).+\\((?<message>.*)\\)$"));
QLatin1String("^'(?<actualexpression>.*)' returned (?<actual>\\w+).+\\((?<message>.*)\\)$"));
static QRegularExpression comparRegex(
QLatin1Literal("^(?<message>.*)\n"
QLatin1String("^(?<message>.*)\n"
"\\s*Actual\\s+\\((?<actualexpression>.*)\\)\\s*: (?<actual>.*)\n"
"\\s*Expected\\s+\\((?<expectedexpresssion>.*)\\)\\s*: (?<expected>.*)$"));
@ -168,22 +168,22 @@ void QTapTestLogger::addIncident(IncidentTypes type, const char *description,
if (match.hasMatch()) {
bool isVerify = match.regularExpression() == verifyRegex;
QString message = match.captured(QLatin1Literal("message"));
QString message = match.captured(QLatin1String("message"));
QString expected;
QString actual;
if (isVerify) {
QString expression = QLatin1Literal(" (")
% match.captured(QLatin1Literal("actualexpression")) % QLatin1Char(')') ;
actual = match.captured(QLatin1Literal("actual")).toLower() % expression;
expected = (actual.startsWith(QLatin1Literal("true")) ? QLatin1Literal("false") : QLatin1Literal("true")) % expression;
QString expression = QLatin1String(" (")
% match.captured(QLatin1String("actualexpression")) % QLatin1Char(')') ;
actual = match.captured(QLatin1String("actual")).toLower() % expression;
expected = (actual.startsWith(QLatin1String("true")) ? QLatin1String("false") : QLatin1String("true")) % expression;
if (message.isEmpty())
message = QLatin1Literal("Verification failed");
message = QLatin1String("Verification failed");
} else {
expected = match.captured(QLatin1Literal("expected"))
% QLatin1Literal(" (") % match.captured(QLatin1Literal("expectedexpresssion")) % QLatin1Char(')');
actual = match.captured(QLatin1Literal("actual"))
% QLatin1Literal(" (") % match.captured(QLatin1Literal("actualexpression")) % QLatin1Char(')');
expected = match.captured(QLatin1String("expected"))
% QLatin1String(" (") % match.captured(QLatin1String("expectedexpresssion")) % QLatin1Char(')');
actual = match.captured(QLatin1String("actual"))
% QLatin1String(" (") % match.captured(QLatin1String("actualexpression")) % QLatin1Char(')');
}
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(QConstString, 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(QConcatenable, QtCore, qstringbuilder.h)
QT_CLASS_LIB(QStringBuilder, QtCore, qstringbuilder.h)

View File

@ -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)

View File

@ -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));

View File

@ -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));

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

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