##// END OF EJS Templates
moved check if a property can be set which was done to early...
florianlink -
r48:44ecc235fd76
parent child
Show More
@@ -316,14 +316,15 static int PythonQtInstanceWrapper_setattro(PyObject *obj,PyObject *name,PyObjec
316 316 if ((attributeName = PyString_AsString(name)) == NULL)
317 317 return -1;
318 318
319 if (!wrapper->_obj) {
320 error = QString("Trying to set attribute '") + attributeName + "' on a destroyed " + wrapper->classInfo()->className() + " object";
321 PyErr_SetString(PyExc_AttributeError, error.toLatin1().data());
322 return -1;
323 }
324
325 319 PythonQtMemberInfo member = wrapper->classInfo()->member(attributeName);
326 320 if (member._type == PythonQtMemberInfo::Property) {
321
322 if (!wrapper->_obj) {
323 error = QString("Trying to set property '") + attributeName + "' on a destroyed " + wrapper->classInfo()->className() + " object";
324 PyErr_SetString(PyExc_AttributeError, error.toLatin1().data());
325 return -1;
326 }
327
327 328 QMetaProperty prop = member._property;
328 329 if (prop.isWritable()) {
329 330 QVariant v;
General Comments 0
You need to be logged in to leave comments. Login now