PythonQt Code
Dynamic Python binding for Qt Applications
Brought to you by:
florianlink,
marcusbarann
--- a/trunk/src/PythonQtClassWrapper.cpp +++ b/trunk/src/PythonQtClassWrapper.cpp @@ -183,9 +183,14 @@ if (wrapper->classInfo()) { PythonQtMemberInfo member = wrapper->classInfo()->member(attributeName); if (member._type == PythonQtMemberInfo::EnumValue) { - return PyInt_FromLong(member._enumValue); - } else - if (member._type == PythonQtMemberInfo::Slot) { + PyObject* enumValue = member._enumValue; + Py_INCREF(enumValue); + return enumValue; + } else if (member._type == PythonQtMemberInfo::EnumWrapper) { + PyObject* enumWrapper = member._enumWrapper; + Py_INCREF(enumWrapper); + return enumWrapper; + } else if (member._type == PythonQtMemberInfo::Slot) { // we return all slots, even the instance slots, since they are callable as unbound slots with self argument return PythonQtSlotFunction_New(member._slot, obj, NULL); }