Menu

Diff of /trunk/src/PythonQtClassWrapper.cpp [r86] .. [r87]  Maximize  Restore

Switch to side-by-side view

--- 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);
     }
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.