MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / firstLeafElement

Function firstLeafElement

pj_plotting/widget/src/PlotDocker.cpp:184–193  ·  view source on GitHub ↗

First leaf-area dock element reachable from `node`, descending into the first child of each splitter. Used to decide between plot-pool and empty-object-widget construction at the top of the restore tree.

Source from the content-addressed store, hash-verified

182// first child of each splitter. Used to decide between plot-pool and
183// empty-object-widget construction at the top of the restore tree.
184QDomElement firstLeafElement(const LayoutNode& node) {
185 const LayoutNode* cur = &node;
186 while (cur->type == LayoutNode::Type::kSplitter && !cur->children.isEmpty()) {
187 cur = &cur->children.front();
188 }
189 if (cur->type == LayoutNode::Type::kArea && !cur->plots.isEmpty()) {
190 return cur->plots.front();
191 }
192 return {};
193}
194
195// A dock's content element is an object widget (Scene3DDockWidget,
196// Scene2DDockWidget, …) when it is present and is not the PlotWidget's own

Callers 2

restoreNodeFunction · 0.85
xmlLoadStateMethod · 0.85

Calls 1

isEmptyMethod · 0.45

Tested by

no test coverage detected