##// END OF EJS Templates
fixed attr lookup and support for invalid (unregistered) properties...
florianlink -
r27:aac16c8308db
parent child
Show More
@@ -241,6 +241,7 static PyObject *PythonQtInstanceWrapper_getattro(PyObject *obj,PyObject *name)
241 241 if (superAttr) {
242 242 return superAttr;
243 243 }
244 PyErr_Clear();
244 245
245 246 if (!wrapper->_obj && !wrapper->_wrappedPtr) {
246 247 QString error = QString("Trying to read attribute '") + attributeName + "' from a destroyed " + wrapper->classInfo()->className() + " object";
@@ -256,7 +257,12 static PyObject *PythonQtInstanceWrapper_getattro(PyObject *obj,PyObject *name)
256 257 switch (member._type) {
257 258 case PythonQtMemberInfo::Property:
258 259 if (wrapper->_obj) {
259 return PythonQtConv::QVariantToPyObject(member._property.read(wrapper->_obj));
260 if (member._property.userType() != QVariant::Invalid) {
261 return PythonQtConv::QVariantToPyObject(member._property.read(wrapper->_obj));
262 } else {
263 Py_INCREF(Py_None);
264 return Py_None;
265 }
260 266 }
261 267 break;
262 268 case PythonQtMemberInfo::Slot:
General Comments 0
You need to be logged in to leave comments. Login now