PythonQtWrapper_QRunnable.cpp
38 lines
| 1.1 KiB
| text/x-c
|
CppLexer
florianlink
|
r13 | #include "PythonQtWrapper_QRunnable.h" | ||
florianlink
|
r24 | #include <PythonQtSignalReceiver.h> | ||
#include <PythonQtMethodInfo.h> | ||||
#include <PythonQtConversion.h> | ||||
florianlink
|
r13 | #include <QVariant> | ||
florianlink
|
r24 | void PythonQtShell_QRunnable::run() | ||
florianlink
|
r13 | { | ||
florianlink
|
r24 | if (_wrapper) { | ||
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "run"); | ||||
PyErr_Clear(); | ||||
if (obj && !PythonQtSlotFunction_Check(obj)) { | ||||
florianlink
|
r73 | static const char* argumentList[] ={""}; | ||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(1, argumentList); | ||||
florianlink
|
r24 | void* args[1] = {NULL}; | ||
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); | ||||
if (result) { Py_DECREF(result); } | ||||
Py_DECREF(obj); | ||||
return; | ||||
} | ||||
} | ||||
florianlink
|
r13 | } | ||
florianlink
|
r24 | QRunnable* PythonQtWrapper_QRunnable::new_QRunnable() | ||
{ | ||||
return new PythonQtShell_QRunnable(); } | ||||
florianlink
|
r13 | |||
florianlink
|
r28 | bool PythonQtWrapper_QRunnable::autoDelete(QRunnable* theWrappedObject) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->autoDelete()); | ||
florianlink
|
r13 | } | ||
florianlink
|
r28 | void PythonQtWrapper_QRunnable::setAutoDelete(QRunnable* theWrappedObject, bool _autoDelete) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | ( theWrappedObject->setAutoDelete(_autoDelete)); | ||
florianlink
|
r13 | } | ||