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.
const QString namespaceDelimiter = "::"_L1;
for (const auto &e : classInfoEntries()) {
const QString klass = QLatin1String(e.klass);
const QString module = QLatin1String(e.module);
QLatin1String header = QLatin1String(e.header);
const QString klass = QLatin1StringView(e.klass);
const QString module = QLatin1StringView(e.module);
QLatin1StringView header = QLatin1StringView(e.header);
if (klass.contains(namespaceDelimiter)) {
m_classToHeader.insert(klass, moduleHeader(module, header));
} else {

View File

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

View File

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

View File

@ -139,7 +139,7 @@ WriteImports::WriteImports(Uic *uic) : WriteIncludesBase(uic),
m_qtClasses(defaultClasses())
{
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)

View File

@ -219,6 +219,7 @@ QT_CLASS_LIB(QStack, QtCore, qstack.h)
QT_CLASS_LIB(QStdWString, QtCore, qstring.h)
QT_CLASS_LIB(QString, 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(QLatin1Literal, QtCore, qstring.h)
QT_CLASS_LIB(QAbstractConcatenable, QtCore, qstringbuilder.h)

View File

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