summaryrefslogtreecommitdiffstats
path: root/src/tools/uic/cpp/cppwritedeclaration.cpp
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2022-04-14 10:21:11 +0200
committerSona Kurazyan <sona.kurazyan@qt.io>2022-04-26 21:59:07 +0200
commitcd9cbc34db2fc27ba505b68af6f6418642058839 (patch)
tree780cc6723897c9236cba81a5ac5907f8419aee06 /src/tools/uic/cpp/cppwritedeclaration.cpp
parent07071e3c0c73bddb22428d7199b828608076631e (diff)
uic: replace QLatin1String uses with _L1 or _s
Task-number: QTBUG-98434 Change-Id: I5a9b01d1dd2a2a727cfb71e829dbf631bf25e2db Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'src/tools/uic/cpp/cppwritedeclaration.cpp')
-rw-r--r--src/tools/uic/cpp/cppwritedeclaration.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/tools/uic/cpp/cppwritedeclaration.cpp b/src/tools/uic/cpp/cppwritedeclaration.cpp
index 9bdfc8ca5c6..2ea7294488e 100644
--- a/src/tools/uic/cpp/cppwritedeclaration.cpp
+++ b/src/tools/uic/cpp/cppwritedeclaration.cpp
@@ -39,6 +39,8 @@
QT_BEGIN_NAMESPACE
+using namespace Qt::StringLiterals;
+
namespace {
void openNameSpaces(const QStringList &namespaceList, QTextStream &output)
{
@@ -77,7 +79,7 @@ void WriteDeclaration::acceptUI(DomUI *node)
if (!exportMacro.isEmpty())
exportMacro.append(u' ');
- QStringList namespaceList = qualifiedClassName.split(QLatin1String("::"));
+ QStringList namespaceList = qualifiedClassName.split("::"_L1);
if (namespaceList.count()) {
className = namespaceList.last();
namespaceList.removeLast();
@@ -89,7 +91,7 @@ void WriteDeclaration::acceptUI(DomUI *node)
// In this case the generated Ui helper classes will also end up in
// the Qt namespace (which is harmless, but not "pretty")
const bool needsMacro = namespaceList.count() == 0
- || namespaceList[0] == QLatin1String("qdesigner_internal");
+ || namespaceList[0] == "qdesigner_internal"_L1;
if (needsMacro)
m_output << "QT_BEGIN_NAMESPACE\n\n";
@@ -105,7 +107,7 @@ void WriteDeclaration::acceptUI(DomUI *node)
const QStringList connections = m_uic->databaseInfo()->connections();
for (const QString &connection : connections) {
- if (connection != QLatin1String("(default)"))
+ if (connection != "(default)"_L1)
m_output << m_option.indent << "QSqlDatabase " << connection << "Connection;\n";
}
@@ -125,7 +127,7 @@ void WriteDeclaration::acceptUI(DomUI *node)
m_output << "\n";
if (m_option.generateNamespace && !m_option.prefix.isEmpty()) {
- namespaceList.append(QLatin1String("Ui"));
+ namespaceList.append("Ui"_L1);
openNameSpaces(namespaceList, m_output);
@@ -143,7 +145,7 @@ void WriteDeclaration::acceptUI(DomUI *node)
void WriteDeclaration::acceptWidget(DomWidget *node)
{
- QString className = QLatin1String("QWidget");
+ QString className = "QWidget"_L1;
if (node->hasAttributeClass())
className = node->attributeClass();
@@ -160,7 +162,7 @@ void WriteDeclaration::acceptSpacer(DomSpacer *node)
void WriteDeclaration::acceptLayout(DomLayout *node)
{
- QString className = QLatin1String("QLayout");
+ QString className = "QLayout"_L1;
if (node->hasAttributeClass())
className = node->attributeClass();