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

Method startEdit

src/Gui/EditableDatumLabelPyImp.cpp:390–416  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

388}
389
390PyObject* EditableDatumLabelPy::startEdit(PyObject* args, PyObject* kwds)
391{
392 static const std::array<const char*, 4> keywords {"value", "eventFilter", "visibleToMouse", nullptr};
393
394 double value = 0.0;
395 PyObject* pyFilter = Py_None;
396 PyObject* pyVisible = Py_False;
397 if (
398 !Base::Wrapped_ParseTupleAndKeywords(args, kwds, "d|OO", keywords, &value, &pyFilter, &pyVisible)
399 ) {
400 return nullptr;
401 }
402
403 QObject* filter = nullptr;
404 if (pyFilter != Py_None) {
405 PythonWrapper wrap;
406 wrap.loadWidgetsModule();
407 filter = wrap.toQObject(Py::Object(pyFilter, false));
408 if (!filter) {
409 PyErr_SetString(PyExc_TypeError, "eventFilter must be a QObject or None");
410 return nullptr;
411 }
412 }
413
414 asLabel(this)->startEdit(value, filter, asBool(pyVisible));
415 Py_Return;
416}
417
418PyObject* EditableDatumLabelPy::stopEdit(PyObject* args)
419{

Callers

nothing calls this directly

Calls 6

asLabelFunction · 0.85
loadWidgetsModuleMethod · 0.80
toQObjectMethod · 0.80
ObjectClass · 0.70
asBoolFunction · 0.70

Tested by

no test coverage detected