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.
| 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. |
| 184 | QDomElement 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 |
no test coverage detected