aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/PySide2/glue
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2019-09-17 13:24:45 +0200
committerChristian Tismer <tismer@stackless.com>2019-09-18 13:08:24 +0200
commit68bcc8ec491edca74b2dc79ee9e0fa3450f0fe30 (patch)
treec77a270934242d2a0c2ff415f4c7891ea855c05d /sources/pyside2/PySide2/glue
parent1cc1c93838ddae86ee6c1cacb467a92aac73b9a0 (diff)
PySide: Clean up indentation, fix refcounts and improve generated code
Change-Id: I5795526cd9d18dda329c9d6694e2fc1269c9d771 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside2/PySide2/glue')
-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);
}