PythonQtWrapper_QObject.cpp
245 lines
| 7.7 KiB
| text/x-c
|
CppLexer
florianlink
|
r13 | #include "PythonQtWrapper_QObject.h" | ||
florianlink
|
r24 | #include <PythonQtSignalReceiver.h> | ||
#include <PythonQtMethodInfo.h> | ||||
#include <PythonQtConversion.h> | ||||
florianlink
|
r13 | #include <QVarLengthArray> | ||
#include <QVariant> | ||||
#include <qbytearray.h> | ||||
#include <qcoreevent.h> | ||||
#include <qlist.h> | ||||
#include <qobject.h> | ||||
florianlink
|
r24 | void PythonQtShell_QObject::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_QObject::staticMetaObject, | ||||
"childEvent(QObject*,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; | ||||
} | ||||
} | ||||
QObject::childEvent(arg__1); | ||||
} | ||||
void PythonQtShell_QObject::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_QObject::staticMetaObject, | ||||
"customEvent(QObject*,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; | ||||
} | ||||
} | ||||
QObject::customEvent(arg__1); | ||||
} | ||||
bool PythonQtShell_QObject::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_QObject::staticMetaObject, | ||||
"event(QObject*,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 QObject::event(arg__1); | ||||
} | ||||
bool PythonQtShell_QObject::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_QObject::staticMetaObject, | ||||
"eventFilter(QObject*,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 QObject::eventFilter(arg__1, arg__2); | ||||
} | ||||
void PythonQtShell_QObject::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_QObject::staticMetaObject, | ||||
"timerEvent(QObject*,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; | ||||
} | ||||
} | ||||
QObject::timerEvent(arg__1); | ||||
} | ||||
florianlink
|
r13 | QObject* PythonQtWrapper_QObject::new_QObject(QObject* parent) | ||
{ | ||||
florianlink
|
r24 | return new PythonQtShell_QObject(parent); } | ||
florianlink
|
r13 | |||
florianlink
|
r28 | void PythonQtWrapper_QObject::customEvent(QObject* theWrappedObject, QEvent* arg__1) | ||
florianlink
|
r13 | { | ||
florianlink
|
r28 | ((PythonQtPublicPromoter_QObject*)theWrappedObject)->promoted_customEvent(arg__1); | ||
florianlink
|
r13 | } | ||
florianlink
|
r28 | void PythonQtWrapper_QObject::childEvent(QObject* theWrappedObject, QChildEvent* arg__1) | ||
florianlink
|
r13 | { | ||
florianlink
|
r28 | ((PythonQtPublicPromoter_QObject*)theWrappedObject)->promoted_childEvent(arg__1); | ||
florianlink
|
r13 | } | ||
florianlink
|
r28 | bool PythonQtWrapper_QObject::isWidgetType(QObject* theWrappedObject) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r28 | return theWrappedObject->isWidgetType(); | ||
florianlink
|
r13 | } | ||
florianlink
|
r28 | QThread* PythonQtWrapper_QObject::thread(QObject* theWrappedObject) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r28 | return theWrappedObject->thread(); | ||
florianlink
|
r13 | } | ||
florianlink
|
r28 | const QList<QObject* >& PythonQtWrapper_QObject::children(QObject* theWrappedObject) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r28 | return theWrappedObject->children(); | ||
florianlink
|
r13 | } | ||
florianlink
|
r28 | bool PythonQtWrapper_QObject::signalsBlocked(QObject* theWrappedObject) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r28 | return theWrappedObject->signalsBlocked(); | ||
florianlink
|
r13 | } | ||
florianlink
|
r28 | bool PythonQtWrapper_QObject::setProperty(QObject* theWrappedObject, const char* name, const QVariant& value) | ||
florianlink
|
r13 | { | ||
florianlink
|
r28 | return theWrappedObject->setProperty(name, value); | ||
florianlink
|
r13 | } | ||
florianlink
|
r28 | void PythonQtWrapper_QObject::killTimer(QObject* theWrappedObject, int id) | ||
florianlink
|
r13 | { | ||
florianlink
|
r28 | theWrappedObject->killTimer(id); | ||
florianlink
|
r13 | } | ||
florianlink
|
r28 | void PythonQtWrapper_QObject::dumpObjectTree(QObject* theWrappedObject) | ||
florianlink
|
r13 | { | ||
florianlink
|
r28 | theWrappedObject->dumpObjectTree(); | ||
florianlink
|
r13 | } | ||
florianlink
|
r28 | QVariant PythonQtWrapper_QObject::property(QObject* theWrappedObject, const char* name) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r28 | return theWrappedObject->property(name); | ||
florianlink
|
r13 | } | ||
florianlink
|
r28 | void PythonQtWrapper_QObject::timerEvent(QObject* theWrappedObject, QTimerEvent* arg__1) | ||
florianlink
|
r13 | { | ||
florianlink
|
r28 | ((PythonQtPublicPromoter_QObject*)theWrappedObject)->promoted_timerEvent(arg__1); | ||
florianlink
|
r13 | } | ||
florianlink
|
r28 | void PythonQtWrapper_QObject::moveToThread(QObject* theWrappedObject, QThread* thread) | ||
florianlink
|
r13 | { | ||
florianlink
|
r28 | theWrappedObject->moveToThread(thread); | ||
florianlink
|
r13 | } | ||
florianlink
|
r28 | QObject* PythonQtWrapper_QObject::parent(QObject* theWrappedObject) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r28 | return theWrappedObject->parent(); | ||
florianlink
|
r13 | } | ||
florianlink
|
r28 | void PythonQtWrapper_QObject::setParent(QObject* theWrappedObject, QObject* arg__1) | ||
florianlink
|
r13 | { | ||
florianlink
|
r28 | theWrappedObject->setParent(arg__1); | ||
florianlink
|
r13 | } | ||
florianlink
|
r28 | void PythonQtWrapper_QObject::dumpObjectInfo(QObject* theWrappedObject) | ||
florianlink
|
r13 | { | ||
florianlink
|
r28 | theWrappedObject->dumpObjectInfo(); | ||
florianlink
|
r13 | } | ||
florianlink
|
r28 | bool PythonQtWrapper_QObject::blockSignals(QObject* theWrappedObject, bool b) | ||
florianlink
|
r13 | { | ||
florianlink
|
r28 | return theWrappedObject->blockSignals(b); | ||
florianlink
|
r13 | } | ||
florianlink
|
r28 | int PythonQtWrapper_QObject::startTimer(QObject* theWrappedObject, int interval) | ||
florianlink
|
r13 | { | ||
florianlink
|
r28 | return theWrappedObject->startTimer(interval); | ||
florianlink
|
r13 | } | ||
florianlink
|
r28 | bool PythonQtWrapper_QObject::eventFilter(QObject* theWrappedObject, QObject* arg__1, QEvent* arg__2) | ||
florianlink
|
r13 | { | ||
florianlink
|
r28 | return ((PythonQtPublicPromoter_QObject*)theWrappedObject)->promoted_eventFilter(arg__1, arg__2); | ||
florianlink
|
r13 | } | ||
florianlink
|
r28 | bool PythonQtWrapper_QObject::event(QObject* theWrappedObject, QEvent* arg__1) | ||
florianlink
|
r13 | { | ||
florianlink
|
r28 | return ((PythonQtPublicPromoter_QObject*)theWrappedObject)->promoted_event(arg__1); | ||
florianlink
|
r13 | } | ||
florianlink
|
r28 | void PythonQtWrapper_QObject::installEventFilter(QObject* theWrappedObject, QObject* arg__1) | ||
florianlink
|
r13 | { | ||
florianlink
|
r28 | theWrappedObject->installEventFilter(arg__1); | ||
florianlink
|
r13 | } | ||
florianlink
|
r28 | void PythonQtWrapper_QObject::removeEventFilter(QObject* theWrappedObject, QObject* arg__1) | ||
florianlink
|
r13 | { | ||
florianlink
|
r28 | theWrappedObject->removeEventFilter(arg__1); | ||
florianlink
|
r13 | } | ||
florianlink
|
r28 | QString PythonQtWrapper_QObject::objectName(QObject* theWrappedObject) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r28 | return theWrappedObject->objectName(); | ||
florianlink
|
r24 | } | ||
florianlink
|
r28 | QList<QByteArray > PythonQtWrapper_QObject::dynamicPropertyNames(QObject* theWrappedObject) const | ||
florianlink
|
r24 | { | ||
florianlink
|
r28 | return theWrappedObject->dynamicPropertyNames(); | ||
florianlink
|
r24 | } | ||
florianlink
|
r28 | void PythonQtWrapper_QObject::setObjectName(QObject* theWrappedObject, const QString& name) | ||
florianlink
|
r24 | { | ||
florianlink
|
r28 | theWrappedObject->setObjectName(name); | ||
florianlink
|
r24 | } | ||
florianlink
|
r28 | bool PythonQtWrapper_QObject::inherits(QObject* theWrappedObject, const char* classname) const | ||
florianlink
|
r24 | { | ||
florianlink
|
r28 | return theWrappedObject->inherits(classname); | ||
florianlink
|
r13 | } | ||