PythonQtWrapper_QSignalMapper.cpp
158 lines
| 5.5 KiB
| text/x-c
|
CppLexer
florianlink
|
r13 | #include "PythonQtWrapper_QSignalMapper.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 <qsignalmapper.h> | ||||
florianlink
|
r24 | void PythonQtShell_QSignalMapper::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; | ||||
} | ||||
} | ||||
QSignalMapper::childEvent(arg__1); | ||||
} | ||||
void PythonQtShell_QSignalMapper::customEvent(QEvent* arg__1) | ||||
florianlink
|
r13 | { | ||
florianlink
|
r24 | 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; | ||||
} | ||||
} | ||||
QSignalMapper::customEvent(arg__1); | ||||
} | ||||
bool PythonQtShell_QSignalMapper::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 QSignalMapper::event(arg__1); | ||||
} | ||||
bool PythonQtShell_QSignalMapper::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 QSignalMapper::eventFilter(arg__1, arg__2); | ||||
florianlink
|
r13 | } | ||
florianlink
|
r24 | void PythonQtShell_QSignalMapper::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; | ||||
} | ||||
} | ||||
QSignalMapper::timerEvent(arg__1); | ||||
} | ||||
QSignalMapper* PythonQtWrapper_QSignalMapper::new_QSignalMapper(QObject* parent) | ||||
{ | ||||
return new PythonQtShell_QSignalMapper(parent); } | ||||
florianlink
|
r13 | |||
florianlink
|
r73 | void PythonQtWrapper_QSignalMapper::setMapping(QSignalMapper* theWrappedObject, QObject* sender, QObject* object) | ||
florianlink
|
r28 | { | ||
florianlink
|
r73 | ( theWrappedObject->setMapping(sender, object)); | ||
florianlink
|
r28 | } | ||
florianlink
|
r73 | void PythonQtWrapper_QSignalMapper::setMapping(QSignalMapper* theWrappedObject, QObject* sender, const QString& text) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | ( theWrappedObject->setMapping(sender, text)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | QObject* PythonQtWrapper_QSignalMapper::mapping(QSignalMapper* theWrappedObject, QObject* object) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->mapping(object)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | QObject* PythonQtWrapper_QSignalMapper::mapping(QSignalMapper* theWrappedObject, int id) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->mapping(id)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | QObject* PythonQtWrapper_QSignalMapper::mapping(QSignalMapper* theWrappedObject, const QString& text) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->mapping(text)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | void PythonQtWrapper_QSignalMapper::setMapping(QSignalMapper* theWrappedObject, QObject* sender, int id) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | ( theWrappedObject->setMapping(sender, id)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | void PythonQtWrapper_QSignalMapper::removeMappings(QSignalMapper* theWrappedObject, QObject* sender) | ||
florianlink
|
r24 | { | ||
florianlink
|
r73 | ( theWrappedObject->removeMappings(sender)); | ||
florianlink
|
r13 | } | ||