aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2023-11-24 11:30:42 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2023-11-29 13:33:13 +0100
commit12cfd8bc1fe621ade4ccc1e4999394966fcd945e (patch)
tree3417aaae68efdf65d3d700945af65e78078c2d71 /sources/pyside6
parent085cb301aeb18f182a93afc6ab52d6569b00f99b (diff)
Fix usages of QLatin1String (deprecation candidate)
Use QLatin1StringView or literals. Task-number: PYSIDE-2537 Change-Id: I03cb9ae80dacd84da9e53648dd179ad79e9189b1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Diffstat (limited to 'sources/pyside6')
-rw-r--r--sources/pyside6/PySide6/glue/qtuitools.cpp4
-rw-r--r--sources/pyside6/libpyside/pyside.cpp2
-rw-r--r--sources/pyside6/libpysideqml/pysideqmlmetacallerror.cpp2
-rw-r--r--sources/pyside6/plugins/designer/designercustomwidgets.cpp7
4 files changed, 7 insertions, 8 deletions
diff --git a/sources/pyside6/PySide6/glue/qtuitools.cpp b/sources/pyside6/PySide6/glue/qtuitools.cpp
index 9e52436e7..9fee3f0a4 100644
--- a/sources/pyside6/PySide6/glue/qtuitools.cpp
+++ b/sources/pyside6/PySide6/glue/qtuitools.cpp
@@ -142,8 +142,8 @@ QXmlStreamReader reader(&uiFile);
while (!reader.atEnd() && baseClassName.isEmpty() && className.isEmpty()) {
auto token = reader.readNext();
if (token == QXmlStreamReader::StartElement && reader.name() == u"widget") {
- baseClassName = reader.attributes().value(QLatin1String("class")).toUtf8();
- className = reader.attributes().value(QLatin1String("name")).toUtf8();
+ baseClassName = reader.attributes().value(QLatin1StringView("class")).toUtf8();
+ className = reader.attributes().value(QLatin1StringView("name")).toUtf8();
}
}
diff --git a/sources/pyside6/libpyside/pyside.cpp b/sources/pyside6/libpyside/pyside.cpp
index 572341e85..891279473 100644
--- a/sources/pyside6/libpyside/pyside.cpp
+++ b/sources/pyside6/libpyside/pyside.cpp
@@ -849,7 +849,7 @@ bool registerInternalQtConf()
QString executablePath = QString::fromWCharArray(Py_GetProgramFullPath());
#else
// PYSIDE-535: FIXME: Add this function when available.
- QString executablePath = QLatin1String("missing Py_GetProgramFullPath");
+ QString executablePath = QLatin1StringView("missing Py_GetProgramFullPath");
#endif // PYPY_VERSION
QString appDirPath = QFileInfo(executablePath).absolutePath();
diff --git a/sources/pyside6/libpysideqml/pysideqmlmetacallerror.cpp b/sources/pyside6/libpysideqml/pysideqmlmetacallerror.cpp
index 8e1381a4e..63cefedb5 100644
--- a/sources/pyside6/libpysideqml/pysideqmlmetacallerror.cpp
+++ b/sources/pyside6/libpysideqml/pysideqmlmetacallerror.cpp
@@ -45,7 +45,7 @@ std::optional<int> qmlMetaCallErrorHandler(QObject *object)
// PYSIDE-464: The error is only valid before PyErr_Restore,
// PYSIDE-464: therefore we take local copies.
Shiboken::AutoDecRef objStr(PyObject_Str(errValue));
- const QString errString = QLatin1String(Shiboken::String::toCString(objStr));
+ const QString errString = QString::fromUtf8(Shiboken::String::toCString(objStr));
const bool isSyntaxError = errType == PyExc_SyntaxError;
const bool isTypeError = errType == PyExc_TypeError;
PyErr_Restore(errType, errValue, errTraceback);
diff --git a/sources/pyside6/plugins/designer/designercustomwidgets.cpp b/sources/pyside6/plugins/designer/designercustomwidgets.cpp
index 6491251b9..89a7e6f60 100644
--- a/sources/pyside6/plugins/designer/designercustomwidgets.cpp
+++ b/sources/pyside6/plugins/designer/designercustomwidgets.cpp
@@ -54,7 +54,7 @@ static QString pyStr(PyObject *o)
static QString pyErrorMessage()
{
- QString result = QLatin1String("<error information not available>");
+ QString result = "<error information not available>"_L1;
PyObject *ptype = {};
PyObject *pvalue = {};
PyObject *ptraceback = {};
@@ -86,7 +86,7 @@ static bool runPyScript(const char *script, QString *errorMessage)
{
PyObject *main = PyImport_AddModule("__main__");
if (main == nullptr) {
- *errorMessage = QLatin1String("Internal error: Cannot retrieve __main__");
+ *errorMessage = "Internal error: Cannot retrieve __main__"_L1;
return false;
}
PyObject *globalDictionary = PyModule_GetDict(main);
@@ -117,8 +117,7 @@ static bool runPyScriptFile(const QString &fileName, QString *errorMessage)
file.close();
const bool ok = runPyScript(script.constData(), errorMessage);
if (!ok && !errorMessage->isEmpty()) {
- errorMessage->prepend(QLatin1String("Error running ") + fileName
- + QLatin1String(": "));
+ errorMessage->prepend("Error running "_L1 + fileName + ": "_L1);
}
return ok;
}