[Gui]overload toQGraphicsItem, toQGraphicsObject for PyObject

This commit is contained in:
wandererfan
2022-12-25 19:43:49 -05:00
committed by WandererFan
parent b36e78658e
commit ef68b1c020
2 changed files with 13 additions and 1 deletions

View File

@@ -563,6 +563,11 @@ QGraphicsItem* PythonWrapper::toQGraphicsItem(PyObject* pyPtr)
return nullptr;
}
QGraphicsItem* PythonWrapper::toQGraphicsItem(const Py::Object& pyobject)
{
return toQGraphicsItem(pyobject.ptr());
}
QGraphicsObject* PythonWrapper::toQGraphicsObject(PyObject* pyPtr)
{
#if defined (HAVE_SHIBOKEN) && defined(HAVE_PYSIDE)
@@ -576,6 +581,12 @@ QGraphicsObject* PythonWrapper::toQGraphicsObject(PyObject* pyPtr)
return nullptr;
}
QGraphicsObject* PythonWrapper::toQGraphicsObject(const Py::Object& pyobject)
{
return toQGraphicsObject(pyobject.ptr());
}
Py::Object PythonWrapper::fromQIcon(const QIcon* icon)
{
#if defined (HAVE_SHIBOKEN) && defined(HAVE_PYSIDE)

View File

@@ -53,10 +53,11 @@ public:
bool toCString(const Py::Object&, std::string&);
QObject* toQObject(const Py::Object&);
QGraphicsItem* toQGraphicsItem(PyObject* ptr);
QGraphicsItem* toQGraphicsItem(const Py::Object& pyObject);
QGraphicsObject* toQGraphicsObject(PyObject* pyPtr);
QGraphicsObject* toQGraphicsObject(const Py::Object& pyObject);
Py::Object fromQPrinter(QPrinter*);
Py::Object fromQObject(QObject*, const char* className=nullptr);
Py::Object fromQWidget(QWidget*, const char* className=nullptr);
const char* getWrapperName(QObject*) const;