Expose attribute to Python to access icon of view provider
This commit is contained in:
@@ -44,6 +44,7 @@
|
||||
# undef _POSIX_C_SOURCE
|
||||
# undef _XOPEN_SOURCE
|
||||
# include <basewrapper.h>
|
||||
# include <conversions.h>
|
||||
# include <sbkmodule.h>
|
||||
# include <typeresolver.h>
|
||||
# include <shiboken.h>
|
||||
@@ -179,6 +180,16 @@ QObject* PythonWrapper::toQObject(const Py::Object& pyobject)
|
||||
return 0;
|
||||
}
|
||||
|
||||
Py::Object PythonWrapper::fromQIcon(const QIcon* icon)
|
||||
{
|
||||
#if defined (HAVE_SHIBOKEN) && defined(HAVE_PYSIDE)
|
||||
PyObject* pyobj = Shiboken::createWrapper<QIcon>(icon, true);
|
||||
if (pyobj)
|
||||
return Py::asObject(pyobj);
|
||||
#endif
|
||||
throw Py::RuntimeError("Failed to wrap icon");
|
||||
}
|
||||
|
||||
Py::Object PythonWrapper::fromQWidget(QWidget* widget, const char* className)
|
||||
{
|
||||
#if defined (HAVE_SHIBOKEN) && defined(HAVE_PYSIDE)
|
||||
|
||||
Reference in New Issue
Block a user