@@ -299,6 +299,7 return Py_None; | |||||
299 | bool ok; |
|
299 | bool ok; | |
300 | int value = PyObjGetInt(obj, true, ok); |
|
300 | int value = PyObjGetInt(obj, true, ok); | |
301 | if (ok && value==0) { |
|
301 | if (ok && value==0) { | |
|
302 | // TODOXXX is this wise? or should it be expected from the programmer to use None? | |||
302 | PythonQtValueStorage_ADD_VALUE_IF_NEEDED(alreadyAllocatedCPPObject,global_ptrStorage, void*, NULL, ptr); |
|
303 | PythonQtValueStorage_ADD_VALUE_IF_NEEDED(alreadyAllocatedCPPObject,global_ptrStorage, void*, NULL, ptr); | |
303 | } |
|
304 | } | |
304 | } |
|
305 | } | |
@@ -460,12 +461,13 return Py_None; | |||||
460 | if (info.enumWrapper) { |
|
461 | if (info.enumWrapper) { | |
461 | unsigned int val; |
|
462 | unsigned int val; | |
462 | if ((PyObject*)obj->ob_type == info.enumWrapper) { |
|
463 | if ((PyObject*)obj->ob_type == info.enumWrapper) { | |
463 |
// we have a |
|
464 | // we have a exact enum type match: | |
464 | val = PyInt_AS_LONG(obj); |
|
465 | val = PyInt_AS_LONG(obj); | |
465 | ok = true; |
|
466 | ok = true; | |
466 | } else { |
|
467 | } else if (!strict) { | |
467 | // we try to get an integer, and in strict mode, it may not be a derived int class, so that no other enum can be taken as an int |
|
468 | // we try to get any integer, when not being strict. If we are strict, integers are not wanted because | |
468 | val = (unsigned int)PyObjGetLongLong(obj, strict, ok); |
|
469 | // we want an integer overload to be taken first! | |
|
470 | val = (unsigned int)PyObjGetLongLong(obj, false, ok); | |||
469 | } |
|
471 | } | |
470 | if (ok) { |
|
472 | if (ok) { | |
471 | PythonQtValueStorage_ADD_VALUE_IF_NEEDED(alreadyAllocatedCPPObject,global_valueStorage, unsigned int, val, ptr); |
|
473 | PythonQtValueStorage_ADD_VALUE_IF_NEEDED(alreadyAllocatedCPPObject,global_valueStorage, unsigned int, val, ptr); |
General Comments 0
You need to be logged in to leave comments.
Login now