MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / fromQImage

Method fromQImage

src/Gui/PythonWrapper.cpp:680–696  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

678}
679
680Py::Object PythonWrapper::fromQImage(const QImage& img)
681{
682#if defined(HAVE_SHIBOKEN) && defined(HAVE_PYSIDE)
683 auto type = getPyTypeObjectForTypeName<QImage>();
684 if (type) {
685 PyObject* pyobj = Shiboken::Conversions::copyToPython(type, const_cast<QImage*>(&img));
686 return Py::asObject(pyobj);
687 }
688#else
689 // Access shiboken/PySide via Python
690 Py::Object obj = qt_wrapInstance<const QImage*>(&img, "QImage", "QtGui");
691 if (!obj.isNull()) {
692 return obj;
693 }
694#endif
695 throw Py::RuntimeError("Failed to wrap image");
696}
697
698QImage* PythonWrapper::toQImage(PyObject* pyobj)
699{

Callers 1

grabFramebufferMethod · 0.80

Calls 1

isNullMethod · 0.45

Tested by

no test coverage detected