summaryrefslogtreecommitdiffstats
path: root/src/tools/uic/python/pythonwriteimports.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/python/pythonwriteimports.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/python/pythonwriteimports.cpp')
-rw-r--r--src/tools/uic/python/pythonwriteimports.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/tools/uic/python/pythonwriteimports.cpp b/src/tools/uic/python/pythonwriteimports.cpp
index cceb0693143..21be6003b9a 100644
--- a/src/tools/uic/python/pythonwriteimports.cpp
+++ b/src/tools/uic/python/pythonwriteimports.cpp
@@ -41,6 +41,8 @@
QT_BEGIN_NAMESPACE
+using namespace Qt::StringLiterals;
+
// Generate imports for Python. Note some things differ from C++:
// - qItemView->header()->setFoo() does not require QHeaderView to be imported
// - qLabel->setFrameShape(QFrame::Box) however requires QFrame to be imported
@@ -84,9 +86,9 @@ static QString pythonResource(QString resource)
const qsizetype lastSlash = resource.lastIndexOf(u'/');
if (lastSlash != -1)
resource.remove(0, lastSlash + 1);
- if (resource.endsWith(QLatin1String(".qrc"))) {
+ if (resource.endsWith(".qrc"_L1)) {
resource.chop(4);
- resource.append(QLatin1String("_rc"));
+ resource.append("_rc"_L1);
}
return resource;
}
@@ -210,7 +212,7 @@ bool WriteImports::addQtClass(const QString &className)
void WriteImports::addPythonCustomWidget(const QString &className, const DomCustomWidget *node)
{
- if (className.contains(QLatin1String("::")))
+ if (className.contains("::"_L1))
return; // Exclude namespaced names (just to make tests pass).
if (addQtClass(className)) // Qt custom widgets like QQuickWidget, QAxWidget, etc
@@ -225,7 +227,7 @@ void WriteImports::addPythonCustomWidget(const QString &className, const DomCust
// Replace the '/' by '.'
modulePath.replace(u'/', u'.');
// '.h' is added by default on headers for <customwidget>
- if (modulePath.endsWith(QLatin1String(".h")))
+ if (modulePath.endsWith(".h"_L1))
modulePath.chop(2);
insertClass(modulePath, className, &m_customWidgets);
}