uic: replace remaining uses of QLatin1String with QLatin1StringView

Task-number: QTBUG-98434
Change-Id: Ied042c0a61e48844694f6a94f0423735e92fb6d3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This commit is contained in:
Sona Kurazyan 2022-04-14 10:33:34 +02:00
parent cd9cbc34db
commit c5e36ca85a
6 changed files with 11 additions and 10 deletions

View File

@ -64,9 +64,9 @@ WriteIncludes::WriteIncludes(Uic *uic) : WriteIncludesBase(uic),
// for the "Phonon::Someclass" classes, however. // for the "Phonon::Someclass" classes, however.
const QString namespaceDelimiter = "::"_L1; const QString namespaceDelimiter = "::"_L1;
for (const auto &e : classInfoEntries()) { for (const auto &e : classInfoEntries()) {
const QString klass = QLatin1String(e.klass); const QString klass = QLatin1StringView(e.klass);
const QString module = QLatin1String(e.module); const QString module = QLatin1StringView(e.module);
QLatin1String header = QLatin1String(e.header); QLatin1StringView header = QLatin1StringView(e.header);
if (klass.contains(namespaceDelimiter)) { if (klass.contains(namespaceDelimiter)) {
m_classToHeader.insert(klass, moduleHeader(module, header)); m_classToHeader.insert(klass, moduleHeader(module, header));
} else { } else {

View File

@ -58,7 +58,7 @@ namespace {
return result; return result;
switch (pstyle->kind()) { switch (pstyle->kind()) {
case DomProperty::Number: case DomProperty::Number:
result = QLatin1String(language::toolbarArea(pstyle->elementNumber())); result = QLatin1StringView(language::toolbarArea(pstyle->elementNumber()));
break; break;
case DomProperty::Enum: case DomProperty::Enum:
result = pstyle->elementEnum(); result = pstyle->elementEnum();
@ -795,7 +795,7 @@ void WriteInitialization::acceptWidget(DomWidget *node)
// //
// Special handling for qtableview/qtreeview fake header attributes // Special handling for qtableview/qtreeview fake header attributes
// //
static const QLatin1String realPropertyNames[] = { static const QLatin1StringView realPropertyNames[] = {
"visible"_L1, "visible"_L1,
"cascadingSectionResizes"_L1, "cascadingSectionResizes"_L1,
"minimumSectionSize"_L1, // before defaultSectionSize "minimumSectionSize"_L1, // before defaultSectionSize
@ -827,7 +827,7 @@ void WriteInitialization::acceptWidget(DomWidget *node)
WritePropertyIgnoreObjectName); WritePropertyIgnoreObjectName);
} else if (cwi->extendsOneOf(className, tables)) { } else if (cwi->extendsOneOf(className, tables)) {
static const QLatin1String headerPrefixes[] = { static const QLatin1StringView headerPrefixes[] = {
"horizontalHeader"_L1, "horizontalHeader"_L1,
"verticalHeader"_L1, "verticalHeader"_L1,
}; };

View File

@ -73,13 +73,13 @@ struct Option
forceMemberFnPtrConnectionSyntax(0), forceMemberFnPtrConnectionSyntax(0),
forceStringConnectionSyntax(0), forceStringConnectionSyntax(0),
useStarImports(0), useStarImports(0),
prefix(QLatin1String("Ui_")) prefix(QLatin1StringView("Ui_"))
{ indent.fill(u' ', 4); } { indent.fill(u' ', 4); }
QString messagePrefix() const QString messagePrefix() const
{ {
return inputFile.isEmpty() ? return inputFile.isEmpty() ?
QString(QLatin1String("stdin")) : QString(QLatin1StringView("stdin")) :
QDir::toNativeSeparators(inputFile); QDir::toNativeSeparators(inputFile);
} }
}; };

View File

@ -139,7 +139,7 @@ WriteImports::WriteImports(Uic *uic) : WriteIncludesBase(uic),
m_qtClasses(defaultClasses()) m_qtClasses(defaultClasses())
{ {
for (const auto &e : classInfoEntries()) for (const auto &e : classInfoEntries())
m_classToModule.insert(QLatin1String(e.klass), QLatin1String(e.module)); m_classToModule.insert(QLatin1StringView(e.klass), QLatin1StringView(e.module));
} }
void WriteImports::acceptUI(DomUI *node) void WriteImports::acceptUI(DomUI *node)

View File

@ -219,6 +219,7 @@ QT_CLASS_LIB(QStack, QtCore, qstack.h)
QT_CLASS_LIB(QStdWString, QtCore, qstring.h) QT_CLASS_LIB(QStdWString, QtCore, qstring.h)
QT_CLASS_LIB(QString, QtCore, qstring.h) QT_CLASS_LIB(QString, QtCore, qstring.h)
QT_CLASS_LIB(QLatin1String, QtCore, qstring.h) QT_CLASS_LIB(QLatin1String, QtCore, qstring.h)
QT_CLASS_LIB(QLatin1StringView, QtCore, qstring.h)
QT_CLASS_LIB(QCharRef, QtCore, qstring.h) QT_CLASS_LIB(QCharRef, QtCore, qstring.h)
QT_CLASS_LIB(QLatin1Literal, QtCore, qstring.h) QT_CLASS_LIB(QLatin1Literal, QtCore, qstring.h)
QT_CLASS_LIB(QAbstractConcatenable, QtCore, qstringbuilder.h) QT_CLASS_LIB(QAbstractConcatenable, QtCore, qstringbuilder.h)

View File

@ -37,7 +37,7 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
inline bool toBool(const QString &str) inline bool toBool(const QString &str)
{ return str.toLower() == QLatin1String("true"); } { return str.toLower() == QLatin1StringView("true"); }
inline QString toString(const DomString *str) inline QString toString(const DomString *str)
{ return str ? str->text() : QString(); } { return str ? str->text() : QString(); }