@@ -256,7 +256,7 return Py_None; | |||||
256 |
|
256 | |||
257 | void* PythonQtConv::ConvertPythonToQt(const PythonQtMethodInfo::ParameterInfo& info, PyObject* obj, bool strict, PythonQtClassInfo* /*classInfo*/, void* alreadyAllocatedCPPObject) |
|
257 | void* PythonQtConv::ConvertPythonToQt(const PythonQtMethodInfo::ParameterInfo& info, PyObject* obj, bool strict, PythonQtClassInfo* /*classInfo*/, void* alreadyAllocatedCPPObject) | |
258 | { |
|
258 | { | |
259 | bool ok; |
|
259 | bool ok = false; | |
260 | void* ptr = NULL; |
|
260 | void* ptr = NULL; | |
261 | if (PyObject_TypeCheck(obj, &PythonQtInstanceWrapper_Type) && info.typeId != PythonQtMethodInfo::Variant) { |
|
261 | if (PyObject_TypeCheck(obj, &PythonQtInstanceWrapper_Type) && info.typeId != PythonQtMethodInfo::Variant) { | |
262 | // if we have a Qt wrapper object and if we do not need a QVariant, we do the following: |
|
262 | // if we have a Qt wrapper object and if we do not need a QVariant, we do the following: | |
@@ -264,7 +264,6 return Py_None; | |||||
264 |
|
264 | |||
265 | // a C++ wrapper (can be passed as pointer or reference) |
|
265 | // a C++ wrapper (can be passed as pointer or reference) | |
266 | PythonQtInstanceWrapper* wrap = (PythonQtInstanceWrapper*)obj; |
|
266 | PythonQtInstanceWrapper* wrap = (PythonQtInstanceWrapper*)obj; | |
267 | bool ok; |
|
|||
268 | void* object = castWrapperTo(wrap, info.name, ok); |
|
267 | void* object = castWrapperTo(wrap, info.name, ok); | |
269 | if (ok) { |
|
268 | if (ok) { | |
270 | if (info.isPointer) { |
|
269 | if (info.isPointer) { | |
@@ -460,6 +459,7 return Py_None; | |||||
460 | // check for enum case |
|
459 | // check for enum case | |
461 | if (info.enumWrapper) { |
|
460 | if (info.enumWrapper) { | |
462 | unsigned int val; |
|
461 | unsigned int val; | |
|
462 | ok = false; | |||
463 | if ((PyObject*)obj->ob_type == info.enumWrapper) { |
|
463 | if ((PyObject*)obj->ob_type == info.enumWrapper) { | |
464 | // we have a exact enum type match: |
|
464 | // we have a exact enum type match: | |
465 | val = PyInt_AS_LONG(obj); |
|
465 | val = PyInt_AS_LONG(obj); |
General Comments 0
You need to be logged in to leave comments.
Login now