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

Method tryModifyMenuBar

src/Gui/WorkbenchManipulatorPython.cpp:94–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92}
93
94void WorkbenchManipulatorPython::tryModifyMenuBar(MenuItem* menuBar)
95{
96 if (object.hasAttr(std::string("modifyMenuBar"))) {
97 Py::Callable method(object.getAttr(std::string("modifyMenuBar")));
98 Py::Tuple args;
99 Py::Object result = method.apply(args);
100 if (result.isDict()) {
101 tryModifyMenuBar(Py::Dict(result), menuBar);
102 }
103 else if (result.isSequence()) {
104 Py::Sequence list(result);
105 for (const auto& it : list) {
106 if (it.isDict()) {
107 tryModifyMenuBar(Py::Dict(it), menuBar);
108 }
109 }
110 }
111 }
112}
113
114// NOLINTNEXTLINE
115void WorkbenchManipulatorPython::tryModifyMenuBar(const Py::Dict& dict, MenuItem* menuBar)

Callers

nothing calls this directly

Calls 10

findParentOfMethod · 0.80
afterItemMethod · 0.80
StringClass · 0.70
applyMethod · 0.45
getItemMethod · 0.45
findItemMethod · 0.45
setCommandMethod · 0.45
insertItemMethod · 0.45
appendItemMethod · 0.45
removeItemMethod · 0.45

Tested by

no test coverage detected