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

Method ExpressionBindingPy

src/Gui/ExpressionBindingPy.cpp:34–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32using namespace Gui;
33
34ExpressionBindingPy::ExpressionBindingPy(Py::PythonClassInstance* self, Py::Tuple& args, Py::Dict& kwds)
35 : Py::PythonClass<ExpressionBindingPy>::PythonClass(self, args, kwds)
36{
37 PyObject* pyObj;
38 if (!PyArg_ParseTuple(args.ptr(), "O", &pyObj)) {
39 throw Py::Exception();
40 }
41
42 PythonWrapper wrap;
43 wrap.loadWidgetsModule();
44
45 QWidget* obj = qobject_cast<QWidget*>(wrap.toQObject(Py::Object(pyObj)));
46 expr = asBinding(obj);
47
48 if (!expr) {
49 throw Py::Exception(PyExc_TypeError, "Wrong type");
50 }
51}
52
53ExpressionBindingPy::~ExpressionBindingPy() = default;
54

Callers

nothing calls this directly

Calls 5

loadWidgetsModuleMethod · 0.80
toQObjectMethod · 0.80
ObjectClass · 0.70
ExceptionClass · 0.50
ptrMethod · 0.45

Tested by

no test coverage detected