diff --git a/src/tools/uic/ui4.cpp b/src/tools/uic/ui4.cpp index a155df9b6ca..d18c7678aea 100644 --- a/src/tools/uic/ui4.cpp +++ b/src/tools/uic/ui4.cpp @@ -32,6 +32,9 @@ QT_BEGIN_NAMESPACE + +using namespace Qt::StringLiterals; + #ifdef QFORMINTERNAL_NAMESPACE using namespace QFormInternal; #endif @@ -60,133 +63,133 @@ void DomUI::read(QXmlStreamReader &reader) const QXmlStreamAttributes &attributes = reader.attributes(); for (const QXmlStreamAttribute &attribute : attributes) { const auto name = attribute.name(); - if (name == QLatin1String("version")) { + if (name == u"version"_s) { setAttributeVersion(attribute.value().toString()); continue; } - if (name == QLatin1String("language")) { + if (name == u"language"_s) { setAttributeLanguage(attribute.value().toString()); continue; } - if (name == QLatin1String("displayname")) { + if (name == u"displayname"_s) { setAttributeDisplayname(attribute.value().toString()); continue; } - if (name == QLatin1String("idbasedtr")) { - setAttributeIdbasedtr(attribute.value() == QLatin1String("true")); + if (name == u"idbasedtr"_s) { + setAttributeIdbasedtr(attribute.value() == u"true"_s); continue; } - if (name == QLatin1String("connectslotsbyname")) { - setAttributeConnectslotsbyname(attribute.value() == QLatin1String("true")); + if (name == u"connectslotsbyname"_s) { + setAttributeConnectslotsbyname(attribute.value() == u"true"_s); continue; } - if (name == QLatin1String("stdsetdef")) { + if (name == u"stdsetdef"_s) { setAttributeStdsetdef(attribute.value().toInt()); continue; } - if (name == QLatin1String("stdSetDef")) { + if (name == u"stdSetDef"_s) { setAttributeStdSetDef(attribute.value().toInt()); continue; } - reader.raiseError(QLatin1String("Unexpected attribute ") + name); + reader.raiseError("Unexpected attribute "_L1 + name); } while (!reader.hasError()) { switch (reader.readNext()) { case QXmlStreamReader::StartElement : { const auto tag = reader.name(); - if (!tag.compare(QLatin1String("author"), Qt::CaseInsensitive)) { + if (!tag.compare(u"author"_s, Qt::CaseInsensitive)) { setElementAuthor(reader.readElementText()); continue; } - if (!tag.compare(QLatin1String("comment"), Qt::CaseInsensitive)) { + if (!tag.compare(u"comment"_s, Qt::CaseInsensitive)) { setElementComment(reader.readElementText()); continue; } - if (!tag.compare(QLatin1String("exportmacro"), Qt::CaseInsensitive)) { + if (!tag.compare(u"exportmacro"_s, Qt::CaseInsensitive)) { setElementExportMacro(reader.readElementText()); continue; } - if (!tag.compare(QLatin1String("class"), Qt::CaseInsensitive)) { + if (!tag.compare(u"class"_s, Qt::CaseInsensitive)) { setElementClass(reader.readElementText()); continue; } - if (!tag.compare(QLatin1String("widget"), Qt::CaseInsensitive)) { + if (!tag.compare(u"widget"_s, Qt::CaseInsensitive)) { auto *v = new DomWidget(); v->read(reader); setElementWidget(v); continue; } - if (!tag.compare(QLatin1String("layoutdefault"), Qt::CaseInsensitive)) { + if (!tag.compare(u"layoutdefault"_s, Qt::CaseInsensitive)) { auto *v = new DomLayoutDefault(); v->read(reader); setElementLayoutDefault(v); continue; } - if (!tag.compare(QLatin1String("layoutfunction"), Qt::CaseInsensitive)) { + if (!tag.compare(u"layoutfunction"_s, Qt::CaseInsensitive)) { auto *v = new DomLayoutFunction(); v->read(reader); setElementLayoutFunction(v); continue; } - if (!tag.compare(QLatin1String("pixmapfunction"), Qt::CaseInsensitive)) { + if (!tag.compare(u"pixmapfunction"_s, Qt::CaseInsensitive)) { setElementPixmapFunction(reader.readElementText()); continue; } - if (!tag.compare(QLatin1String("customwidgets"), Qt::CaseInsensitive)) { + if (!tag.compare(u"customwidgets"_s, Qt::CaseInsensitive)) { auto *v = new DomCustomWidgets(); v->read(reader); setElementCustomWidgets(v); continue; } - if (!tag.compare(QLatin1String("tabstops"), Qt::CaseInsensitive)) { + if (!tag.compare(u"tabstops"_s, Qt::CaseInsensitive)) { auto *v = new DomTabStops(); v->read(reader); setElementTabStops(v); continue; } - if (!tag.compare(QLatin1String("images"), Qt::CaseInsensitive)) { + if (!tag.compare(u"images"_s, Qt::CaseInsensitive)) { qWarning("Omitting deprecated element ."); reader.skipCurrentElement(); continue; } - if (!tag.compare(QLatin1String("includes"), Qt::CaseInsensitive)) { + if (!tag.compare(u"includes"_s, Qt::CaseInsensitive)) { auto *v = new DomIncludes(); v->read(reader); setElementIncludes(v); continue; } - if (!tag.compare(QLatin1String("resources"), Qt::CaseInsensitive)) { + if (!tag.compare(u"resources"_s, Qt::CaseInsensitive)) { auto *v = new DomResources(); v->read(reader); setElementResources(v); continue; } - if (!tag.compare(QLatin1String("connections"), Qt::CaseInsensitive)) { + if (!tag.compare(u"connections"_s, Qt::CaseInsensitive)) { auto *v = new DomConnections(); v->read(reader); setElementConnections(v); continue; } - if (!tag.compare(QLatin1String("designerdata"), Qt::CaseInsensitive)) { + if (!tag.compare(u"designerdata"_s, Qt::CaseInsensitive)) { auto *v = new DomDesignerData(); v->read(reader); setElementDesignerdata(v); continue; } - if (!tag.compare(QLatin1String("slots"), Qt::CaseInsensitive)) { + if (!tag.compare(u"slots"_s, Qt::CaseInsensitive)) { auto *v = new DomSlots(); v->read(reader); setElementSlots(v); continue; } - if (!tag.compare(QLatin1String("buttongroups"), Qt::CaseInsensitive)) { + if (!tag.compare(u"buttongroups"_s, Qt::CaseInsensitive)) { auto *v = new DomButtonGroups(); v->read(reader); setElementButtonGroups(v); continue; } - reader.raiseError(QLatin1String("Unexpected element ") + tag); + reader.raiseError("Unexpected element "_L1 + tag); } break; case QXmlStreamReader::EndElement : @@ -202,73 +205,73 @@ void DomUI::write(QXmlStreamWriter &writer, const QString &tagName) const writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("ui") : tagName.toLower()); if (hasAttributeVersion()) - writer.writeAttribute(QStringLiteral("version"), attributeVersion()); + writer.writeAttribute(u"version"_s, attributeVersion()); if (hasAttributeLanguage()) - writer.writeAttribute(QStringLiteral("language"), attributeLanguage()); + writer.writeAttribute(u"language"_s, attributeLanguage()); if (hasAttributeDisplayname()) - writer.writeAttribute(QStringLiteral("displayname"), attributeDisplayname()); + writer.writeAttribute(u"displayname"_s, attributeDisplayname()); if (hasAttributeIdbasedtr()) - writer.writeAttribute(QStringLiteral("idbasedtr"), (attributeIdbasedtr() ? QLatin1String("true") : QLatin1String("false"))); + writer.writeAttribute(u"idbasedtr"_s, (attributeIdbasedtr() ? u"true"_s : u"false"_s)); if (hasAttributeConnectslotsbyname()) - writer.writeAttribute(QStringLiteral("connectslotsbyname"), (attributeConnectslotsbyname() ? QLatin1String("true") : QLatin1String("false"))); + writer.writeAttribute(u"connectslotsbyname"_s, (attributeConnectslotsbyname() ? u"true"_s : u"false"_s)); if (hasAttributeStdsetdef()) - writer.writeAttribute(QStringLiteral("stdsetdef"), QString::number(attributeStdsetdef())); + writer.writeAttribute(u"stdsetdef"_s, QString::number(attributeStdsetdef())); if (hasAttributeStdSetDef()) - writer.writeAttribute(QStringLiteral("stdsetdef"), QString::number(attributeStdSetDef())); + writer.writeAttribute(u"stdsetdef"_s, QString::number(attributeStdSetDef())); if (m_children & Author) - writer.writeTextElement(QStringLiteral("author"), m_author); + writer.writeTextElement(u"author"_s, m_author); if (m_children & Comment) - writer.writeTextElement(QStringLiteral("comment"), m_comment); + writer.writeTextElement(u"comment"_s, m_comment); if (m_children & ExportMacro) - writer.writeTextElement(QStringLiteral("exportmacro"), m_exportMacro); + writer.writeTextElement(u"exportmacro"_s, m_exportMacro); if (m_children & Class) - writer.writeTextElement(QStringLiteral("class"), m_class); + writer.writeTextElement(u"class"_s, m_class); if (m_children & Widget) - m_widget->write(writer, QStringLiteral("widget")); + m_widget->write(writer, u"widget"_s); if (m_children & LayoutDefault) - m_layoutDefault->write(writer, QStringLiteral("layoutdefault")); + m_layoutDefault->write(writer, u"layoutdefault"_s); if (m_children & LayoutFunction) - m_layoutFunction->write(writer, QStringLiteral("layoutfunction")); + m_layoutFunction->write(writer, u"layoutfunction"_s); if (m_children & PixmapFunction) - writer.writeTextElement(QStringLiteral("pixmapfunction"), m_pixmapFunction); + writer.writeTextElement(u"pixmapfunction"_s, m_pixmapFunction); if (m_children & CustomWidgets) - m_customWidgets->write(writer, QStringLiteral("customwidgets")); + m_customWidgets->write(writer, u"customwidgets"_s); if (m_children & TabStops) - m_tabStops->write(writer, QStringLiteral("tabstops")); + m_tabStops->write(writer, u"tabstops"_s); if (m_children & Includes) - m_includes->write(writer, QStringLiteral("includes")); + m_includes->write(writer, u"includes"_s); if (m_children & Resources) - m_resources->write(writer, QStringLiteral("resources")); + m_resources->write(writer, u"resources"_s); if (m_children & Connections) - m_connections->write(writer, QStringLiteral("connections")); + m_connections->write(writer, u"connections"_s); if (m_children & Designerdata) - m_designerdata->write(writer, QStringLiteral("designerdata")); + m_designerdata->write(writer, u"designerdata"_s); if (m_children & Slots) - m_slots->write(writer, QStringLiteral("slots")); + m_slots->write(writer, u"slots"_s); if (m_children & ButtonGroups) - m_buttonGroups->write(writer, QStringLiteral("buttongroups")); + m_buttonGroups->write(writer, u"buttongroups"_s); writer.writeEndElement(); } @@ -582,13 +585,13 @@ void DomIncludes::read(QXmlStreamReader &reader) switch (reader.readNext()) { case QXmlStreamReader::StartElement : { const auto tag = reader.name(); - if (!tag.compare(QLatin1String("include"), Qt::CaseInsensitive)) { + if (!tag.compare(u"include"_s, Qt::CaseInsensitive)) { auto *v = new DomInclude(); v->read(reader); m_include.append(v); continue; } - reader.raiseError(QLatin1String("Unexpected element ") + tag); + reader.raiseError("Unexpected element "_L1 + tag); } break; case QXmlStreamReader::EndElement : @@ -604,7 +607,7 @@ void DomIncludes::write(QXmlStreamWriter &writer, const QString &tagName) const writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("includes") : tagName.toLower()); for (DomInclude *v : m_include) - v->write(writer, QStringLiteral("include")); + v->write(writer, u"include"_s); writer.writeEndElement(); } @@ -622,22 +625,22 @@ void DomInclude::read(QXmlStreamReader &reader) const QXmlStreamAttributes &attributes = reader.attributes(); for (const QXmlStreamAttribute &attribute : attributes) { const auto name = attribute.name(); - if (name == QLatin1String("location")) { + if (name == u"location"_s) { setAttributeLocation(attribute.value().toString()); continue; } - if (name == QLatin1String("impldecl")) { + if (name == u"impldecl"_s) { setAttributeImpldecl(attribute.value().toString()); continue; } - reader.raiseError(QLatin1String("Unexpected attribute ") + name); + reader.raiseError("Unexpected attribute "_L1 + name); } while (!reader.hasError()) { switch (reader.readNext()) { case QXmlStreamReader::StartElement : { const auto tag = reader.name(); - reader.raiseError(QLatin1String("Unexpected element ") + tag); + reader.raiseError("Unexpected element "_L1 + tag); } break; case QXmlStreamReader::EndElement : @@ -657,10 +660,10 @@ void DomInclude::write(QXmlStreamWriter &writer, const QString &tagName) const writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("include") : tagName.toLower()); if (hasAttributeLocation()) - writer.writeAttribute(QStringLiteral("location"), attributeLocation()); + writer.writeAttribute(u"location"_s, attributeLocation()); if (hasAttributeImpldecl()) - writer.writeAttribute(QStringLiteral("impldecl"), attributeImpldecl()); + writer.writeAttribute(u"impldecl"_s, attributeImpldecl()); if (!m_text.isEmpty()) writer.writeCharacters(m_text); @@ -679,24 +682,24 @@ void DomResources::read(QXmlStreamReader &reader) const QXmlStreamAttributes &attributes = reader.attributes(); for (const QXmlStreamAttribute &attribute : attributes) { const auto name = attribute.name(); - if (name == QLatin1String("name")) { + if (name == u"name"_s) { setAttributeName(attribute.value().toString()); continue; } - reader.raiseError(QLatin1String("Unexpected attribute ") + name); + reader.raiseError("Unexpected attribute "_L1 + name); } while (!reader.hasError()) { switch (reader.readNext()) { case QXmlStreamReader::StartElement : { const auto tag = reader.name(); - if (!tag.compare(QLatin1String("include"), Qt::CaseInsensitive)) { + if (!tag.compare(u"include"_s, Qt::CaseInsensitive)) { auto *v = new DomResource(); v->read(reader); m_include.append(v); continue; } - reader.raiseError(QLatin1String("Unexpected element ") + tag); + reader.raiseError("Unexpected element "_L1 + tag); } break; case QXmlStreamReader::EndElement : @@ -712,10 +715,10 @@ void DomResources::write(QXmlStreamWriter &writer, const QString &tagName) const writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("resources") : tagName.toLower()); if (hasAttributeName()) - writer.writeAttribute(QStringLiteral("name"), attributeName()); + writer.writeAttribute(u"name"_s, attributeName()); for (DomResource *v : m_include) - v->write(writer, QStringLiteral("include")); + v->write(writer, u"include"_s); writer.writeEndElement(); } @@ -733,18 +736,18 @@ void DomResource::read(QXmlStreamReader &reader) const QXmlStreamAttributes &attributes = reader.attributes(); for (const QXmlStreamAttribute &attribute : attributes) { const auto name = attribute.name(); - if (name == QLatin1String("location")) { + if (name == u"location"_s) { setAttributeLocation(attribute.value().toString()); continue; } - reader.raiseError(QLatin1String("Unexpected attribute ") + name); + reader.raiseError("Unexpected attribute "_L1 + name); } while (!reader.hasError()) { switch (reader.readNext()) { case QXmlStreamReader::StartElement : { const auto tag = reader.name(); - reader.raiseError(QLatin1String("Unexpected element ") + tag); + reader.raiseError("Unexpected element "_L1 + tag); } break; case QXmlStreamReader::EndElement : @@ -760,7 +763,7 @@ void DomResource::write(QXmlStreamWriter &writer, const QString &tagName) const writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("resource") : tagName.toLower()); if (hasAttributeLocation()) - writer.writeAttribute(QStringLiteral("location"), attributeLocation()); + writer.writeAttribute(u"location"_s, attributeLocation()); writer.writeEndElement(); } @@ -782,42 +785,42 @@ void DomActionGroup::read(QXmlStreamReader &reader) const QXmlStreamAttributes &attributes = reader.attributes(); for (const QXmlStreamAttribute &attribute : attributes) { const auto name = attribute.name(); - if (name == QLatin1String("name")) { + if (name == u"name"_s) { setAttributeName(attribute.value().toString()); continue; } - reader.raiseError(QLatin1String("Unexpected attribute ") + name); + reader.raiseError("Unexpected attribute "_L1 + name); } while (!reader.hasError()) { switch (reader.readNext()) { case QXmlStreamReader::StartElement : { const auto tag = reader.name(); - if (!tag.compare(QLatin1String("action"), Qt::CaseInsensitive)) { + if (!tag.compare(u"action"_s, Qt::CaseInsensitive)) { auto *v = new DomAction(); v->read(reader); m_action.append(v); continue; } - if (!tag.compare(QLatin1String("actiongroup"), Qt::CaseInsensitive)) { + if (!tag.compare(u"actiongroup"_s, Qt::CaseInsensitive)) { auto *v = new DomActionGroup(); v->read(reader); m_actionGroup.append(v); continue; } - if (!tag.compare(QLatin1String("property"), Qt::CaseInsensitive)) { + if (!tag.compare(u"property"_s, Qt::CaseInsensitive)) { auto *v = new DomProperty(); v->read(reader); m_property.append(v); continue; } - if (!tag.compare(QLatin1String("attribute"), Qt::CaseInsensitive)) { + if (!tag.compare(u"attribute"_s, Qt::CaseInsensitive)) { auto *v = new DomProperty(); v->read(reader); m_attribute.append(v); continue; } - reader.raiseError(QLatin1String("Unexpected element ") + tag); + reader.raiseError("Unexpected element "_L1 + tag); } break; case QXmlStreamReader::EndElement : @@ -833,19 +836,19 @@ void DomActionGroup::write(QXmlStreamWriter &writer, const QString &tagName) con writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("actiongroup") : tagName.toLower()); if (hasAttributeName()) - writer.writeAttribute(QStringLiteral("name"), attributeName()); + writer.writeAttribute(u"name"_s, attributeName()); for (DomAction *v : m_action) - v->write(writer, QStringLiteral("action")); + v->write(writer, u"action"_s); for (DomActionGroup *v : m_actionGroup) - v->write(writer, QStringLiteral("actiongroup")); + v->write(writer, u"actiongroup"_s); for (DomProperty *v : m_property) - v->write(writer, QStringLiteral("property")); + v->write(writer, u"property"_s); for (DomProperty *v : m_attribute) - v->write(writer, QStringLiteral("attribute")); + v->write(writer, u"attribute"_s); writer.writeEndElement(); } @@ -887,34 +890,34 @@ void DomAction::read(QXmlStreamReader &reader) const QXmlStreamAttributes &attributes = reader.attributes(); for (const QXmlStreamAttribute &attribute : attributes) { const auto name = attribute.name(); - if (name == QLatin1String("name")) { + if (name == u"name"_s) { setAttributeName(attribute.value().toString()); continue; } - if (name == QLatin1String("menu")) { + if (name == u"menu"_s) { setAttributeMenu(attribute.value().toString()); continue; } - reader.raiseError(QLatin1String("Unexpected attribute ") + name); + reader.raiseError("Unexpected attribute "_L1 + name); } while (!reader.hasError()) { switch (reader.readNext()) { case QXmlStreamReader::StartElement : { const auto tag = reader.name(); - if (!tag.compare(QLatin1String("property"), Qt::CaseInsensitive)) { + if (!tag.compare(u"property"_s, Qt::CaseInsensitive)) { auto *v = new DomProperty(); v->read(reader); m_property.append(v); continue; } - if (!tag.compare(QLatin1String("attribute"), Qt::CaseInsensitive)) { + if (!tag.compare(u"attribute"_s, Qt::CaseInsensitive)) { auto *v = new DomProperty(); v->read(reader); m_attribute.append(v); continue; } - reader.raiseError(QLatin1String("Unexpected element ") + tag); + reader.raiseError("Unexpected element "_L1 + tag); } break; case QXmlStreamReader::EndElement : @@ -930,16 +933,16 @@ void DomAction::write(QXmlStreamWriter &writer, const QString &tagName) const writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("action") : tagName.toLower()); if (hasAttributeName()) - writer.writeAttribute(QStringLiteral("name"), attributeName()); + writer.writeAttribute(u"name"_s, attributeName()); if (hasAttributeMenu()) - writer.writeAttribute(QStringLiteral("menu"), attributeMenu()); + writer.writeAttribute(u"menu"_s, attributeMenu()); for (DomProperty *v : m_property) - v->write(writer, QStringLiteral("property")); + v->write(writer, u"property"_s); for (DomProperty *v : m_attribute) - v->write(writer, QStringLiteral("attribute")); + v->write(writer, u"attribute"_s); writer.writeEndElement(); } @@ -963,18 +966,18 @@ void DomActionRef::read(QXmlStreamReader &reader) const QXmlStreamAttributes &attributes = reader.attributes(); for (const QXmlStreamAttribute &attribute : attributes) { const auto name = attribute.name(); - if (name == QLatin1String("name")) { + if (name == u"name"_s) { setAttributeName(attribute.value().toString()); continue; } - reader.raiseError(QLatin1String("Unexpected attribute ") + name); + reader.raiseError("Unexpected attribute "_L1 + name); } while (!reader.hasError()) { switch (reader.readNext()) { case QXmlStreamReader::StartElement : { const auto tag = reader.name(); - reader.raiseError(QLatin1String("Unexpected element ") + tag); + reader.raiseError("Unexpected element "_L1 + tag); } break; case QXmlStreamReader::EndElement : @@ -990,7 +993,7 @@ void DomActionRef::write(QXmlStreamWriter &writer, const QString &tagName) const writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("actionref") : tagName.toLower()); if (hasAttributeName()) - writer.writeAttribute(QStringLiteral("name"), attributeName()); + writer.writeAttribute(u"name"_s, attributeName()); writer.writeEndElement(); } @@ -1008,30 +1011,30 @@ void DomButtonGroup::read(QXmlStreamReader &reader) const QXmlStreamAttributes &attributes = reader.attributes(); for (const QXmlStreamAttribute &attribute : attributes) { const auto name = attribute.name(); - if (name == QLatin1String("name")) { + if (name == u"name"_s) { setAttributeName(attribute.value().toString()); continue; } - reader.raiseError(QLatin1String("Unexpected attribute ") + name); + reader.raiseError("Unexpected attribute "_L1 + name); } while (!reader.hasError()) { switch (reader.readNext()) { case QXmlStreamReader::StartElement : { const auto tag = reader.name(); - if (!tag.compare(QLatin1String("property"), Qt::CaseInsensitive)) { + if (!tag.compare(u"property"_s, Qt::CaseInsensitive)) { auto *v = new DomProperty(); v->read(reader); m_property.append(v); continue; } - if (!tag.compare(QLatin1String("attribute"), Qt::CaseInsensitive)) { + if (!tag.compare(u"attribute"_s, Qt::CaseInsensitive)) { auto *v = new DomProperty(); v->read(reader); m_attribute.append(v); continue; } - reader.raiseError(QLatin1String("Unexpected element ") + tag); + reader.raiseError("Unexpected element "_L1 + tag); } break; case QXmlStreamReader::EndElement : @@ -1047,13 +1050,13 @@ void DomButtonGroup::write(QXmlStreamWriter &writer, const QString &tagName) con writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("buttongroup") : tagName.toLower()); if (hasAttributeName()) - writer.writeAttribute(QStringLiteral("name"), attributeName()); + writer.writeAttribute(u"name"_s, attributeName()); for (DomProperty *v : m_property) - v->write(writer, QStringLiteral("property")); + v->write(writer, u"property"_s); for (DomProperty *v : m_attribute) - v->write(writer, QStringLiteral("attribute")); + v->write(writer, u"attribute"_s); writer.writeEndElement(); } @@ -1082,13 +1085,13 @@ void DomButtonGroups::read(QXmlStreamReader &reader) switch (reader.readNext()) { case QXmlStreamReader::StartElement : { const auto tag = reader.name(); - if (!tag.compare(QLatin1String("buttongroup"), Qt::CaseInsensitive)) { + if (!tag.compare(u"buttongroup"_s, Qt::CaseInsensitive)) { auto *v = new DomButtonGroup(); v->read(reader); m_buttonGroup.append(v); continue; } - reader.raiseError(QLatin1String("Unexpected element ") + tag); + reader.raiseError("Unexpected element "_L1 + tag); } break; case QXmlStreamReader::EndElement : @@ -1104,7 +1107,7 @@ void DomButtonGroups::write(QXmlStreamWriter &writer, const QString &tagName) co writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("buttongroups") : tagName.toLower()); for (DomButtonGroup *v : m_buttonGroup) - v->write(writer, QStringLiteral("buttongroup")); + v->write(writer, u"buttongroup"_s); writer.writeEndElement(); } @@ -1127,13 +1130,13 @@ void DomCustomWidgets::read(QXmlStreamReader &reader) switch (reader.readNext()) { case QXmlStreamReader::StartElement : { const auto tag = reader.name(); - if (!tag.compare(QLatin1String("customwidget"), Qt::CaseInsensitive)) { + if (!tag.compare(u"customwidget"_s, Qt::CaseInsensitive)) { auto *v = new DomCustomWidget(); v->read(reader); m_customWidget.append(v); continue; } - reader.raiseError(QLatin1String("Unexpected element ") + tag); + reader.raiseError("Unexpected element "_L1 + tag); } break; case QXmlStreamReader::EndElement : @@ -1149,7 +1152,7 @@ void DomCustomWidgets::write(QXmlStreamWriter &writer, const QString &tagName) c writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("customwidgets") : tagName.toLower()); for (DomCustomWidget *v : m_customWidget) - v->write(writer, QStringLiteral("customwidget")); + v->write(writer, u"customwidget"_s); writer.writeEndElement(); } @@ -1167,18 +1170,18 @@ void DomHeader::read(QXmlStreamReader &reader) const QXmlStreamAttributes &attributes = reader.attributes(); for (const QXmlStreamAttribute &attribute : attributes) { const auto name = attribute.name(); - if (name == QLatin1String("location")) { + if (name == u"location"_s) { setAttributeLocation(attribute.value().toString()); continue; } - reader.raiseError(QLatin1String("Unexpected attribute ") + name); + reader.raiseError("Unexpected attribute "_L1 + name); } while (!reader.hasError()) { switch (reader.readNext()) { case QXmlStreamReader::StartElement : { const auto tag = reader.name(); - reader.raiseError(QLatin1String("Unexpected element ") + tag); + reader.raiseError("Unexpected element "_L1 + tag); } break; case QXmlStreamReader::EndElement : @@ -1198,7 +1201,7 @@ void DomHeader::write(QXmlStreamWriter &writer, const QString &tagName) const writer.writeStartElement(tagName.isEmpty() ? QStringLiteral("header") : tagName.toLower()); if (hasAttributeLocation()) - writer.writeAttribute(QStringLiteral("location"), attributeLocation()); + writer.writeAttribute(u"location"_s, attributeLocation()); if (!m_text.isEmpty()) writer.writeCharacters(m_text); @@ -1220,66 +1223,66 @@ void DomCustomWidget::read(QXmlStreamReader &reader) switch (reader.readNext()) { case QXmlStreamReader::StartElement : { const auto tag = reader.name(); - if (!tag.compare(QLatin1String("class"), Qt::CaseInsensitive)) { + if (!tag.compare(u"class"_s, Qt::CaseInsensitive)) { setElementClass(reader.readElementText()); continue; } - if (!tag.compare(QLatin1String("extends"), Qt::CaseInsensitive)) { + if (!tag.compare(u"extends"_s, Qt::CaseInsensitive)) { setElementExtends(reader.readElementText()); continue; } - if (!tag.compare(QLatin1String("header"), Qt::CaseInsensitive)) { + if (!tag.compare(u"header"_s, Qt::CaseInsensitive)) { auto *v = new DomHeader(); v->read(reader); setElementHeader(v); continue; } - if (!tag.compare(QLatin1String("sizehint"), Qt::CaseInsensitive)) { + if (!tag.compare(u"sizehint"_s, Qt::CaseInsensitive)) { auto *v = new DomSize(); v->read(reader); setElementSizeHint(v); continue; } - if (!tag.compare(QLatin1String("addpagemethod"), Qt::CaseInsensitive)) { + if (!tag.compare(u"addpagemethod"_s, Qt::CaseInsensitive)) { setElementAddPageMethod(reader.readElementText()); continue; } - if (!tag.compare(QLatin1String("container"), Qt::CaseInsensitive)) { + if (!tag.compare(u"container"_s, Qt::CaseInsensitive)) { setElementContainer(reader.readElementText().toInt()); continue; } - if (!tag.compare(QLatin1String("sizepolicy"), Qt::CaseInsensitive)) { + if (!tag.compare(u"sizepolicy"_s, Qt::CaseInsensitive)) { qWarning("Omitting deprecated element ."); reader.skipCurrentElement(); continue; } - if (!tag.compare(QLatin1String("pixmap"), Qt::CaseInsensitive)) { + if (!tag.compare(u"pixmap"_s, Qt::CaseInsensitive)) { setElementPixmap(reader.readElementText()); continue; } - if (!tag.compare(QLatin1String("script"), Qt::CaseInsensitive)) { + if (!tag.compare(u"script"_s, Qt::CaseInsensitive)) { qWarning("Omitting deprecated element