PythonQtWrapper_QTimer.cpp
155 lines
| 5.0 KiB
| text/x-c
|
CppLexer
florianlink
|
r13 | #include "PythonQtWrapper_QTimer.h" | ||
florianlink
|
r24 | #include <PythonQtSignalReceiver.h> | ||
#include <PythonQtMethodInfo.h> | ||||
#include <PythonQtConversion.h> | ||||
florianlink
|
r13 | #include <QVariant> | ||
#include <qbytearray.h> | ||||
#include <qcoreevent.h> | ||||
#include <qlist.h> | ||||
#include <qobject.h> | ||||
#include <qtimer.h> | ||||
florianlink
|
r24 | void PythonQtShell_QTimer::childEvent(QChildEvent* arg__1) | ||
{ | ||||
if (_wrapper) { | ||||
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "childEvent"); | ||||
PyErr_Clear(); | ||||
if (obj && !PythonQtSlotFunction_Check(obj)) { | ||||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromMetaObjectAndSignature( | ||||
&PythonQtWrapper_QTimer::staticMetaObject, | ||||
"childEvent(QTimer*,QChildEvent* )"); | ||||
void* args[2] = {NULL, (void*)&arg__1}; | ||||
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); | ||||
if (result) { Py_DECREF(result); } | ||||
Py_DECREF(obj); | ||||
return; | ||||
} | ||||
} | ||||
QTimer::childEvent(arg__1); | ||||
} | ||||
void PythonQtShell_QTimer::customEvent(QEvent* arg__1) | ||||
{ | ||||
if (_wrapper) { | ||||
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "customEvent"); | ||||
PyErr_Clear(); | ||||
if (obj && !PythonQtSlotFunction_Check(obj)) { | ||||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromMetaObjectAndSignature( | ||||
&PythonQtWrapper_QTimer::staticMetaObject, | ||||
"customEvent(QTimer*,QEvent* )"); | ||||
void* args[2] = {NULL, (void*)&arg__1}; | ||||
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); | ||||
if (result) { Py_DECREF(result); } | ||||
Py_DECREF(obj); | ||||
return; | ||||
} | ||||
} | ||||
QTimer::customEvent(arg__1); | ||||
} | ||||
bool PythonQtShell_QTimer::event(QEvent* arg__1) | ||||
{ | ||||
if (_wrapper) { | ||||
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "event"); | ||||
PyErr_Clear(); | ||||
if (obj && !PythonQtSlotFunction_Check(obj)) { | ||||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromMetaObjectAndSignature( | ||||
&PythonQtWrapper_QTimer::staticMetaObject, | ||||
"event(QTimer*,QEvent* )"); | ||||
bool returnValue; | ||||
void* args[2] = {NULL, (void*)&arg__1}; | ||||
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); | ||||
if (result) { | ||||
args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); | ||||
if (args[0]!=&returnValue) { | ||||
returnValue = *((bool *)args[0]); | ||||
} | ||||
} | ||||
if (result) { Py_DECREF(result); } | ||||
Py_DECREF(obj); | ||||
return returnValue; | ||||
} | ||||
} | ||||
return QTimer::event(arg__1); | ||||
} | ||||
bool PythonQtShell_QTimer::eventFilter(QObject* arg__1, QEvent* arg__2) | ||||
{ | ||||
if (_wrapper) { | ||||
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "eventFilter"); | ||||
PyErr_Clear(); | ||||
if (obj && !PythonQtSlotFunction_Check(obj)) { | ||||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromMetaObjectAndSignature( | ||||
&PythonQtWrapper_QTimer::staticMetaObject, | ||||
"eventFilter(QTimer*,QObject* ,QEvent* )"); | ||||
bool returnValue; | ||||
void* args[3] = {NULL, (void*)&arg__1, (void*)&arg__2}; | ||||
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); | ||||
if (result) { | ||||
args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); | ||||
if (args[0]!=&returnValue) { | ||||
returnValue = *((bool *)args[0]); | ||||
} | ||||
} | ||||
if (result) { Py_DECREF(result); } | ||||
Py_DECREF(obj); | ||||
return returnValue; | ||||
} | ||||
} | ||||
return QTimer::eventFilter(arg__1, arg__2); | ||||
} | ||||
void PythonQtShell_QTimer::timerEvent(QTimerEvent* arg__1) | ||||
{ | ||||
if (_wrapper) { | ||||
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "timerEvent"); | ||||
PyErr_Clear(); | ||||
if (obj && !PythonQtSlotFunction_Check(obj)) { | ||||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromMetaObjectAndSignature( | ||||
&PythonQtWrapper_QTimer::staticMetaObject, | ||||
"timerEvent(QTimer*,QTimerEvent* )"); | ||||
void* args[2] = {NULL, (void*)&arg__1}; | ||||
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); | ||||
if (result) { Py_DECREF(result); } | ||||
Py_DECREF(obj); | ||||
return; | ||||
} | ||||
} | ||||
QTimer::timerEvent(arg__1); | ||||
} | ||||
florianlink
|
r13 | QTimer* PythonQtWrapper_QTimer::new_QTimer(QObject* parent) | ||
{ | ||||
florianlink
|
r24 | return new PythonQtShell_QTimer(parent); } | ||
florianlink
|
r13 | |||
florianlink
|
r24 | void PythonQtWrapper_QTimer::setInterval(QTimer* theWrappedObject, int msec) | ||
florianlink
|
r13 | { | ||
florianlink
|
r28 | theWrappedObject->setInterval(msec); | ||
florianlink
|
r13 | } | ||
bool PythonQtWrapper_QTimer::isActive(QTimer* theWrappedObject) const | ||||
{ | ||||
florianlink
|
r28 | return theWrappedObject->isActive(); | ||
florianlink
|
r24 | } | ||
int PythonQtWrapper_QTimer::interval(QTimer* theWrappedObject) const | ||||
{ | ||||
florianlink
|
r28 | return theWrappedObject->interval(); | ||
florianlink
|
r13 | } | ||
bool PythonQtWrapper_QTimer::isSingleShot(QTimer* theWrappedObject) const | ||||
{ | ||||
florianlink
|
r28 | return theWrappedObject->isSingleShot(); | ||
florianlink
|
r13 | } | ||
florianlink
|
r24 | int PythonQtWrapper_QTimer::timerId(QTimer* theWrappedObject) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r28 | return theWrappedObject->timerId(); | ||
florianlink
|
r13 | } | ||
void PythonQtWrapper_QTimer::setSingleShot(QTimer* theWrappedObject, bool singleShot) | ||||
{ | ||||
florianlink
|
r28 | theWrappedObject->setSingleShot(singleShot); | ||
florianlink
|
r13 | } | ||
florianlink
|
r24 | void PythonQtWrapper_QTimer::timerEvent(QTimer* theWrappedObject, QTimerEvent* arg__1) | ||
florianlink
|
r13 | { | ||
florianlink
|
r28 | ((PythonQtPublicPromoter_QTimer*)theWrappedObject)->promoted_timerEvent(arg__1); | ||
florianlink
|
r13 | } | ||