PythonQtWrapper_QItemEditorFactory.cpp
89 lines
| 3.4 KiB
| text/x-c
|
CppLexer
|
r13 | #include "PythonQtWrapper_QItemEditorFactory.h" | ||
|
r24 | #include <PythonQtSignalReceiver.h> | ||
#include <PythonQtMethodInfo.h> | ||||
#include <PythonQtConversion.h> | ||||
|
r13 | #include <QVariant> | ||
#include <qbytearray.h> | ||||
#include <qitemeditorfactory.h> | ||||
#include <qwidget.h> | ||||
|
r24 | QWidget* PythonQtShell_QItemEditorFactory::createEditor(QVariant::Type type, QWidget* parent) const | ||
{ | ||||
if (_wrapper) { | ||||
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "createEditor"); | ||||
PyErr_Clear(); | ||||
if (obj && !PythonQtSlotFunction_Check(obj)) { | ||||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromMetaObjectAndSignature( | ||||
&PythonQtWrapper_QItemEditorFactory::staticMetaObject, | ||||
"createEditor(QItemEditorFactory*,QVariant::Type ,QWidget* )"); | ||||
QWidget* returnValue; | ||||
void* args[3] = {NULL, (void*)&type, (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; | ||||
} | ||||
} | ||||
return QItemEditorFactory::createEditor(type, parent); | ||||
} | ||||
QByteArray PythonQtShell_QItemEditorFactory::valuePropertyName(QVariant::Type type) const | ||||
{ | ||||
if (_wrapper) { | ||||
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "valuePropertyName"); | ||||
PyErr_Clear(); | ||||
if (obj && !PythonQtSlotFunction_Check(obj)) { | ||||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromMetaObjectAndSignature( | ||||
&PythonQtWrapper_QItemEditorFactory::staticMetaObject, | ||||
"valuePropertyName(QItemEditorFactory*,QVariant::Type )"); | ||||
QByteArray returnValue; | ||||
void* args[2] = {NULL, (void*)&type}; | ||||
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; | ||||
} | ||||
} | ||||
return QItemEditorFactory::valuePropertyName(type); | ||||
} | ||||
|
r13 | QItemEditorFactory* PythonQtWrapper_QItemEditorFactory::new_QItemEditorFactory() | ||
{ | ||||
|
r24 | return new PythonQtShell_QItemEditorFactory(); } | ||
|
r13 | |||
QWidget* PythonQtWrapper_QItemEditorFactory::createEditor(QItemEditorFactory* theWrappedObject, QVariant::Type type, QWidget* parent) const | ||||
{ | ||||
|
r28 | return ((PythonQtPublicPromoter_QItemEditorFactory*)theWrappedObject)->promoted_createEditor(type, parent); | ||
|
r13 | } | ||
|
r24 | void PythonQtWrapper_QItemEditorFactory::static_QItemEditorFactory_setDefaultFactory(QItemEditorFactory* factory) | ||
|
r13 | { | ||
|
r24 | QItemEditorFactory::setDefaultFactory(factory); | ||
|
r13 | } | ||
|
r24 | const QItemEditorFactory* PythonQtWrapper_QItemEditorFactory::static_QItemEditorFactory_defaultFactory() | ||
|
r13 | { | ||
|
r24 | return QItemEditorFactory::defaultFactory(); | ||
|
r13 | } | ||
|
r24 | void PythonQtWrapper_QItemEditorFactory::registerEditor(QItemEditorFactory* theWrappedObject, QVariant::Type type, QItemEditorCreatorBase* creator) | ||
|
r13 | { | ||
|
r28 | theWrappedObject->registerEditor(type, creator); | ||
|
r13 | } | ||
QByteArray PythonQtWrapper_QItemEditorFactory::valuePropertyName(QItemEditorFactory* theWrappedObject, QVariant::Type type) const | ||||
{ | ||||
|
r28 | return ((PythonQtPublicPromoter_QItemEditorFactory*)theWrappedObject)->promoted_valuePropertyName(type); | ||
|
r13 | } | ||