PythonQtWrapper_QItemEditorCreatorBase.cpp
65 lines
| 2.3 KiB
| text/x-c
|
CppLexer
|
r13 | #include "PythonQtWrapper_QItemEditorCreatorBase.h" | ||
|
r24 | #include <PythonQtSignalReceiver.h> | ||
#include <PythonQtMethodInfo.h> | ||||
#include <PythonQtConversion.h> | ||||
|
r13 | #include <QVariant> | ||
#include <qbytearray.h> | ||||
#include <qwidget.h> | ||||
|
r24 | QWidget* PythonQtShell_QItemEditorCreatorBase::createWidget(QWidget* parent) const | ||
|
r13 | { | ||
|
r24 | if (_wrapper) { | ||
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "createWidget"); | ||||
PyErr_Clear(); | ||||
if (obj && !PythonQtSlotFunction_Check(obj)) { | ||||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromMetaObjectAndSignature( | ||||
&PythonQtWrapper_QItemEditorCreatorBase::staticMetaObject, | ||||
"createWidget(QItemEditorCreatorBase*,QWidget* )"); | ||||
QWidget* returnValue; | ||||
void* args[2] = {NULL, (void*)&parent}; | ||||
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 = *((QWidget* *)args[0]); | ||||
} | ||||
} | ||||
if (result) { Py_DECREF(result); } | ||||
Py_DECREF(obj); | ||||
return returnValue; | ||||
} | ||||
|
r13 | } | ||
|
r24 | QWidget* result; | ||
return result; | ||||
} | ||||
QByteArray PythonQtShell_QItemEditorCreatorBase::valuePropertyName() const | ||||
|
r13 | { | ||
|
r24 | if (_wrapper) { | ||
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "valuePropertyName"); | ||||
PyErr_Clear(); | ||||
if (obj && !PythonQtSlotFunction_Check(obj)) { | ||||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromMetaObjectAndSignature( | ||||
&PythonQtWrapper_QItemEditorCreatorBase::staticMetaObject, | ||||
"valuePropertyName(QItemEditorCreatorBase*)"); | ||||
QByteArray returnValue; | ||||
void* args[1] = {NULL}; | ||||
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 = *((QByteArray *)args[0]); | ||||
} | ||||
} | ||||
if (result) { Py_DECREF(result); } | ||||
Py_DECREF(obj); | ||||
return returnValue; | ||||
} | ||||
} | ||||
QByteArray result; | ||||
return result; | ||||
|
r13 | } | ||
|
r24 | QItemEditorCreatorBase* PythonQtWrapper_QItemEditorCreatorBase::new_QItemEditorCreatorBase() | ||
{ | ||||
return new PythonQtShell_QItemEditorCreatorBase(); } | ||||
|
r13 | |||