aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrenatofilho <renato.filho@openbossa.org>2010-10-22 16:20:58 -0300
committerrenatofilho <renato.filho@openbossa.org>2010-10-22 18:03:25 -0300
commit800fb4613cb61dbff33750ec0ab4b18ca3369c6c (patch)
treecbe72437801373819c9191cb8e0fcf146372c173
parent76fa1124908009ec1eaab0960dd542d6cc0e2c66 (diff)
Put signals register before property registration.
Reviewer: Hugo Parente Lima <hugo.pl@gmail.com> Luciano Wolf <luciano.wolf@openbossa.org>
-rw-r--r--libpyside/dynamicqmetaobject.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/libpyside/dynamicqmetaobject.cpp b/libpyside/dynamicqmetaobject.cpp
index 88497843a..a16a35469 100644
--- a/libpyside/dynamicqmetaobject.cpp
+++ b/libpyside/dynamicqmetaobject.cpp
@@ -404,12 +404,13 @@ DynamicQMetaObject* DynamicQMetaObject::createBasedOn(PyObject* pyObj, PyTypeObj
className = className.mid(className.lastIndexOf('.')+1);
DynamicQMetaObject *mo = new PySide::DynamicQMetaObject(className.toAscii(), base);
+ QList<PyObject*> properties;
+
while (PyDict_Next(type->tp_dict, &pos, &key, &value)) {
- //Register properties
- if (value->ob_type == &PySideQPropertyType) {
- mo->addProperty(PyString_AsString(key), value);
- }
+ //Leave the properties to be register after signals because of notify object
+ if (value->ob_type == &PySideQPropertyType)
+ properties.append(key);
//Register signals
if (value->ob_type == &PySideSignalType) {
@@ -440,6 +441,13 @@ DynamicQMetaObject* DynamicQMetaObject::createBasedOn(PyObject* pyObj, PyTypeObj
}
}
}
+
+ //Register properties
+ foreach(PyObject* key, properties) {
+ PyObject* value = PyDict_GetItem(type->tp_dict, key);
+ mo->addProperty(PyString_AsString(key), value);
+ }
+
return mo;
}