aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/PySide2/glue/qtuitools.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside2/PySide2/glue/qtuitools.cpp')
-rw-r--r--sources/pyside2/PySide2/glue/qtuitools.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/sources/pyside2/PySide2/glue/qtuitools.cpp b/sources/pyside2/PySide2/glue/qtuitools.cpp
index 552a9009c..00fc8e44a 100644
--- a/sources/pyside2/PySide2/glue/qtuitools.cpp
+++ b/sources/pyside2/PySide2/glue/qtuitools.cpp
@@ -54,9 +54,10 @@ static void createChildrenNameAttributes(PyObject *root, QObject *object)
const QByteArray name = child->objectName().toLocal8Bit();
if (!name.isEmpty() && !name.startsWith("_") && !name.startsWith("qt_")) {
- if (!PyObject_HasAttrString(root, name.constData())) {
+ Shiboken::AutoDecRef attrName(Py_BuildValue("s", name.constData()));
+ if (!PyObject_HasAttr(root, attrName)) {
Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QObject *](child));
- PyObject_SetAttrString(root, name.constData(), pyChild);
+ PyObject_SetAttr(root, attrName, pyChild);
}
createChildrenNameAttributes(root, child);
}