PythonQtWrapper_QItemEditorFactory.cpp
95 lines
| 3.7 KiB
| text/x-c
|
CppLexer
florianlink
|
r13 | #include "PythonQtWrapper_QItemEditorFactory.h" | ||
florianlink
|
r24 | #include <PythonQtSignalReceiver.h> | ||
#include <PythonQtMethodInfo.h> | ||||
#include <PythonQtConversion.h> | ||||
florianlink
|
r13 | #include <QVariant> | ||
#include <qbytearray.h> | ||||
#include <qitemeditorfactory.h> | ||||
#include <qwidget.h> | ||||
florianlink
|
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)) { | ||||
florianlink
|
r73 | static const char* argumentList[] ={"QWidget*" , "QVariant::Type" , "QWidget*"}; | ||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); | ||||
QWidget* returnValue; | ||||
florianlink
|
r24 | 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) { | ||||
florianlink
|
r73 | if (args[0]==NULL) { | ||
PythonQt::priv()->handleVirtualOverloadReturnError("createEditor", methodInfo, result); | ||||
} else { | ||||
returnValue = *((QWidget**)args[0]); | ||||
} | ||||
florianlink
|
r24 | } | ||
} | ||||
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)) { | ||||
florianlink
|
r73 | static const char* argumentList[] ={"QByteArray" , "QVariant::Type"}; | ||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); | ||||
QByteArray returnValue; | ||||
florianlink
|
r24 | 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) { | ||||
florianlink
|
r73 | if (args[0]==NULL) { | ||
PythonQt::priv()->handleVirtualOverloadReturnError("valuePropertyName", methodInfo, result); | ||||
} else { | ||||
returnValue = *((QByteArray*)args[0]); | ||||
} | ||||
florianlink
|
r24 | } | ||
} | ||||
if (result) { Py_DECREF(result); } | ||||
Py_DECREF(obj); | ||||
return returnValue; | ||||
} | ||||
} | ||||
return QItemEditorFactory::valuePropertyName(type); | ||||
} | ||||
florianlink
|
r13 | QItemEditorFactory* PythonQtWrapper_QItemEditorFactory::new_QItemEditorFactory() | ||
{ | ||||
florianlink
|
r24 | return new PythonQtShell_QItemEditorFactory(); } | ||
florianlink
|
r13 | |||
florianlink
|
r24 | void PythonQtWrapper_QItemEditorFactory::static_QItemEditorFactory_setDefaultFactory(QItemEditorFactory* factory) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | (QItemEditorFactory::setDefaultFactory(factory)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r24 | const QItemEditorFactory* PythonQtWrapper_QItemEditorFactory::static_QItemEditorFactory_defaultFactory() | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return (QItemEditorFactory::defaultFactory()); | ||
florianlink
|
r13 | } | ||
florianlink
|
r24 | void PythonQtWrapper_QItemEditorFactory::registerEditor(QItemEditorFactory* theWrappedObject, QVariant::Type type, QItemEditorCreatorBase* creator) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | ( theWrappedObject->registerEditor(type, creator)); | ||
florianlink
|
r13 | } | ||
QByteArray PythonQtWrapper_QItemEditorFactory::valuePropertyName(QItemEditorFactory* theWrappedObject, QVariant::Type type) const | ||||
{ | ||||
florianlink
|
r73 | return ( ((PythonQtPublicPromoter_QItemEditorFactory*)theWrappedObject)->promoted_valuePropertyName(type)); | ||
} | ||||
QWidget* PythonQtWrapper_QItemEditorFactory::createEditor(QItemEditorFactory* theWrappedObject, QVariant::Type type, QWidget* parent) const | ||||
{ | ||||
return ( ((PythonQtPublicPromoter_QItemEditorFactory*)theWrappedObject)->promoted_createEditor(type, parent)); | ||||
florianlink
|
r13 | } | ||