aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside6')
-rw-r--r--sources/pyside6/libpyside/dynamicqmetaobject.cpp5
-rw-r--r--sources/pyside6/libpyside/pyside.cpp5
2 files changed, 6 insertions, 4 deletions
diff --git a/sources/pyside6/libpyside/dynamicqmetaobject.cpp b/sources/pyside6/libpyside/dynamicqmetaobject.cpp
index 5c57d397d..e7dc35fef 100644
--- a/sources/pyside6/libpyside/dynamicqmetaobject.cpp
+++ b/sources/pyside6/libpyside/dynamicqmetaobject.cpp
@@ -624,9 +624,10 @@ void MetaObjectBuilderPrivate::parsePythonType(PyTypeObject *type)
while (PyDict_Next(attrs, &pos, &key, &value)) {
if (Property::checkType(value)) {
- const int index = m_baseObject->indexOfProperty(String::toCString(key));
+ const QByteArray name = String::toCString(key);
+ const int index = m_baseObject->indexOfProperty(name);
if (index == -1)
- addProperty(String::toCString(key), value);
+ addProperty(name, value);
} else if (Py_TYPE(value)->tp_call != nullptr) {
// PYSIDE-198: PyFunction_Check does not work with Nuitka.
// Register slots.
diff --git a/sources/pyside6/libpyside/pyside.cpp b/sources/pyside6/libpyside/pyside.cpp
index eb2cd9559..6d98b63d7 100644
--- a/sources/pyside6/libpyside/pyside.cpp
+++ b/sources/pyside6/libpyside/pyside.cpp
@@ -470,7 +470,6 @@ const QMetaObject *retrieveMetaObject(PyObject *pyObj)
void initQObjectSubType(PyTypeObject *type, PyObject *args, PyObject * /* kwds */)
{
PyTypeObject *qObjType = Shiboken::Conversions::getPythonTypeObject("QObject*");
- QByteArray className(Shiboken::String::toCString(PyTuple_GET_ITEM(args, 0)));
PyObject *bases = PyTuple_GET_ITEM(args, 1);
int numBases = PyTuple_GET_SIZE(bases);
@@ -485,7 +484,9 @@ void initQObjectSubType(PyTypeObject *type, PyObject *args, PyObject * /* kwds *
}
}
if (!userData) {
- qWarning("Sub class of QObject not inheriting QObject!? Crash will happen when using %s.", className.constData());
+ const char *className = Shiboken::String::toCString(PyTuple_GET_ITEM(args, 0));
+ qWarning("Sub class of QObject not inheriting QObject!? Crash will happen when using %s.",
+ className);
return;
}
// PYSIDE-1463: Don't change feature selection durin subtype initialization.