PythonQtWrapper_QFileIconProvider.cpp
104 lines
| 3.8 KiB
| text/x-c
|
CppLexer
florianlink
|
r13 | #include "PythonQtWrapper_QFileIconProvider.h" | ||
florianlink
|
r24 | #include <PythonQtSignalReceiver.h> | ||
#include <PythonQtMethodInfo.h> | ||||
#include <PythonQtConversion.h> | ||||
florianlink
|
r13 | #include <QVariant> | ||
#include <qfileiconprovider.h> | ||||
#include <qfileinfo.h> | ||||
#include <qicon.h> | ||||
florianlink
|
r24 | QIcon PythonQtShell_QFileIconProvider::icon(QFileIconProvider::IconType type) const | ||
{ | ||||
if (_wrapper) { | ||||
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "icon"); | ||||
PyErr_Clear(); | ||||
if (obj && !PythonQtSlotFunction_Check(obj)) { | ||||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromMetaObjectAndSignature( | ||||
&PythonQtWrapper_QFileIconProvider::staticMetaObject, | ||||
"icon(QFileIconProvider*,QFileIconProvider::IconType )"); | ||||
QIcon 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 = *((QIcon *)args[0]); | ||||
} | ||||
} | ||||
if (result) { Py_DECREF(result); } | ||||
Py_DECREF(obj); | ||||
return returnValue; | ||||
} | ||||
} | ||||
return QFileIconProvider::icon(type); | ||||
} | ||||
QIcon PythonQtShell_QFileIconProvider::icon(const QFileInfo& info) const | ||||
{ | ||||
if (_wrapper) { | ||||
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "icon"); | ||||
PyErr_Clear(); | ||||
if (obj && !PythonQtSlotFunction_Check(obj)) { | ||||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromMetaObjectAndSignature( | ||||
&PythonQtWrapper_QFileIconProvider::staticMetaObject, | ||||
"icon(QFileIconProvider*,const QFileInfo& )"); | ||||
QIcon returnValue; | ||||
void* args[2] = {NULL, (void*)&info}; | ||||
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 = *((QIcon *)args[0]); | ||||
} | ||||
} | ||||
if (result) { Py_DECREF(result); } | ||||
Py_DECREF(obj); | ||||
return returnValue; | ||||
} | ||||
} | ||||
return QFileIconProvider::icon(info); | ||||
} | ||||
QString PythonQtShell_QFileIconProvider::type(const QFileInfo& info) const | ||||
{ | ||||
if (_wrapper) { | ||||
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "type"); | ||||
PyErr_Clear(); | ||||
if (obj && !PythonQtSlotFunction_Check(obj)) { | ||||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromMetaObjectAndSignature( | ||||
&PythonQtWrapper_QFileIconProvider::staticMetaObject, | ||||
"type(QFileIconProvider*,const QFileInfo& )"); | ||||
QString returnValue; | ||||
void* args[2] = {NULL, (void*)&info}; | ||||
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 = *((QString *)args[0]); | ||||
} | ||||
} | ||||
if (result) { Py_DECREF(result); } | ||||
Py_DECREF(obj); | ||||
return returnValue; | ||||
} | ||||
} | ||||
return QFileIconProvider::type(info); | ||||
} | ||||
florianlink
|
r13 | QFileIconProvider* PythonQtWrapper_QFileIconProvider::new_QFileIconProvider() | ||
{ | ||||
florianlink
|
r24 | return new PythonQtShell_QFileIconProvider(); } | ||
florianlink
|
r13 | |||
florianlink
|
r28 | QIcon PythonQtWrapper_QFileIconProvider::icon(QFileIconProvider* theWrappedObject, QFileIconProvider::IconType type) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r28 | return ((PythonQtPublicPromoter_QFileIconProvider*)theWrappedObject)->promoted_icon(type); | ||
florianlink
|
r13 | } | ||
florianlink
|
r28 | QString PythonQtWrapper_QFileIconProvider::type(QFileIconProvider* theWrappedObject, const QFileInfo& info) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r28 | return ((PythonQtPublicPromoter_QFileIconProvider*)theWrappedObject)->promoted_type(info); | ||
florianlink
|
r13 | } | ||
florianlink
|
r28 | QIcon PythonQtWrapper_QFileIconProvider::icon(QFileIconProvider* theWrappedObject, const QFileInfo& info) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r28 | return ((PythonQtPublicPromoter_QFileIconProvider*)theWrappedObject)->promoted_icon(info); | ||
florianlink
|
r13 | } | ||