PythonQtWrapper_QObject.cpp
255 lines
| 8.1 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)) { | ||||
florianlink
|
r73 | static const char* argumentList[] ={"" , "QChildEvent*"}; | ||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); | ||||
florianlink
|
r24 | 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)) { | ||||
florianlink
|
r73 | static const char* argumentList[] ={"" , "QEvent*"}; | ||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); | ||||
florianlink
|
r24 | 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)) { | ||||
florianlink
|
r73 | static const char* argumentList[] ={"bool" , "QEvent*"}; | ||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); | ||||
bool returnValue; | ||||
florianlink
|
r24 | 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) { | ||||
florianlink
|
r73 | if (args[0]==NULL) { | ||
PythonQt::priv()->handleVirtualOverloadReturnError("event", methodInfo, result); | ||||
} else { | ||||
returnValue = *((bool*)args[0]); | ||||
} | ||||
florianlink
|
r24 | } | ||
} | ||||
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)) { | ||||
florianlink
|
r73 | static const char* argumentList[] ={"bool" , "QObject*" , "QEvent*"}; | ||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); | ||||
bool returnValue; | ||||
florianlink
|
r24 | 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) { | ||||
florianlink
|
r73 | if (args[0]==NULL) { | ||
PythonQt::priv()->handleVirtualOverloadReturnError("eventFilter", methodInfo, result); | ||||
} else { | ||||
returnValue = *((bool*)args[0]); | ||||
} | ||||
florianlink
|
r24 | } | ||
} | ||||
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)) { | ||||
florianlink
|
r73 | static const char* argumentList[] ={"" , "QTimerEvent*"}; | ||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); | ||||
florianlink
|
r24 | 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
|
r73 | bool PythonQtWrapper_QObject::blockSignals(QObject* theWrappedObject, bool b) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->blockSignals(b)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | QList<QByteArray > PythonQtWrapper_QObject::dynamicPropertyNames(QObject* theWrappedObject) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->dynamicPropertyNames()); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | QString PythonQtWrapper_QObject::objectName(QObject* theWrappedObject) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->objectName()); | ||
} | ||||
void PythonQtWrapper_QObject::customEvent(QObject* theWrappedObject, QEvent* arg__1) | ||||
{ | ||||
( ((PythonQtPublicPromoter_QObject*)theWrappedObject)->promoted_customEvent(arg__1)); | ||||
florianlink
|
r13 | } | ||
florianlink
|
r28 | QThread* PythonQtWrapper_QObject::thread(QObject* theWrappedObject) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->thread()); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | bool PythonQtWrapper_QObject::isWidgetType(QObject* theWrappedObject) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->isWidgetType()); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | void PythonQtWrapper_QObject::moveToThread(QObject* theWrappedObject, QThread* thread) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | ( theWrappedObject->moveToThread(thread)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | void PythonQtWrapper_QObject::setObjectName(QObject* theWrappedObject, const QString& name) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | ( theWrappedObject->setObjectName(name)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | void PythonQtWrapper_QObject::childEvent(QObject* theWrappedObject, QChildEvent* arg__1) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | ( ((PythonQtPublicPromoter_QObject*)theWrappedObject)->promoted_childEvent(arg__1)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | void PythonQtWrapper_QObject::dumpObjectInfo(QObject* theWrappedObject) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | ( theWrappedObject->dumpObjectInfo()); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | const QList<QObject* >* PythonQtWrapper_QObject::children(QObject* theWrappedObject) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return &( theWrappedObject->children()); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | void PythonQtWrapper_QObject::setParent(QObject* theWrappedObject, QObject* arg__1) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | ( theWrappedObject->setParent(arg__1)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | bool PythonQtWrapper_QObject::setProperty(QObject* theWrappedObject, const char* name, const QVariant& value) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->setProperty(name, value)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | bool PythonQtWrapper_QObject::eventFilter(QObject* theWrappedObject, QObject* arg__1, QEvent* arg__2) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( ((PythonQtPublicPromoter_QObject*)theWrappedObject)->promoted_eventFilter(arg__1, arg__2)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | void PythonQtWrapper_QObject::removeEventFilter(QObject* theWrappedObject, QObject* arg__1) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | ( theWrappedObject->removeEventFilter(arg__1)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | bool PythonQtWrapper_QObject::inherits(QObject* theWrappedObject, const char* classname) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->inherits(classname)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | void PythonQtWrapper_QObject::dumpObjectTree(QObject* theWrappedObject) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | ( theWrappedObject->dumpObjectTree()); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | void PythonQtWrapper_QObject::timerEvent(QObject* theWrappedObject, QTimerEvent* arg__1) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | ( ((PythonQtPublicPromoter_QObject*)theWrappedObject)->promoted_timerEvent(arg__1)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | QObject* PythonQtWrapper_QObject::parent(QObject* theWrappedObject) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->parent()); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | bool PythonQtWrapper_QObject::signalsBlocked(QObject* theWrappedObject) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->signalsBlocked()); | ||
florianlink
|
r13 | } | ||
florianlink
|
r28 | void PythonQtWrapper_QObject::installEventFilter(QObject* theWrappedObject, QObject* arg__1) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | ( theWrappedObject->installEventFilter(arg__1)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | bool PythonQtWrapper_QObject::event(QObject* theWrappedObject, QEvent* arg__1) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( ((PythonQtPublicPromoter_QObject*)theWrappedObject)->promoted_event(arg__1)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | QVariant PythonQtWrapper_QObject::property(QObject* theWrappedObject, const char* name) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->property(name)); | ||
florianlink
|
r24 | } | ||
florianlink
|
r73 | int PythonQtWrapper_QObject::startTimer(QObject* theWrappedObject, int interval) | ||
florianlink
|
r24 | { | ||
florianlink
|
r73 | return ( theWrappedObject->startTimer(interval)); | ||
florianlink
|
r24 | } | ||
florianlink
|
r73 | void PythonQtWrapper_QObject::killTimer(QObject* theWrappedObject, int id) | ||
florianlink
|
r24 | { | ||
florianlink
|
r73 | ( theWrappedObject->killTimer(id)); | ||
florianlink
|
r24 | } | ||
florianlink
|
r73 | QString PythonQtWrapper_QObject::toString(QObject* obj) { | ||
QString result; | ||||
QDebug d(&result); | ||||
d << obj; | ||||
return result; | ||||
florianlink
|
r13 | } | ||