| 1329 | } |
| 1330 | |
| 1331 | void MainWindow::onObjectFamilyRequested(DockWidget* dock, VisualizationKind family) { |
| 1332 | if (dock == nullptr) { |
| 1333 | return; |
| 1334 | } |
| 1335 | // The shell is the only module that maps a UI family to a concrete object-widget |
| 1336 | // kind. A switch (no default) makes a future enumerator a compile error here — |
| 1337 | // the one site that owns the mapping. Plot never reaches this slot (DockWidget |
| 1338 | // builds plots itself), so it is a defensive no-op. |
| 1339 | QString kind; |
| 1340 | switch (family) { |
| 1341 | case VisualizationKind::kScene2D: |
| 1342 | kind = QStringLiteral("scene2d"); |
| 1343 | break; |
| 1344 | case VisualizationKind::kScene3D: |
| 1345 | kind = QStringLiteral("scene3d"); |
| 1346 | break; |
| 1347 | case VisualizationKind::kPlot: |
| 1348 | return; |
| 1349 | } |
| 1350 | IDataWidget* widget = makeSeededEmptyObjectDock(kind, dock); |
| 1351 | if (widget == nullptr) { |
| 1352 | // Both scene kinds are valid, so this is a programming error rather than a |
| 1353 | // user-facing one — log it instead of silently leaving the placeholder. |
| 1354 | qCWarning(lcMain) << "onObjectFamilyRequested: could not build scene dock for kind" << kind; |
| 1355 | } |
| 1356 | dock->adoptObjectWidget(widget); // null still reverts to a usable placeholder |
| 1357 | } |
| 1358 | |
| 1359 | MainWindow::~MainWindow() { |
| 1360 | // Break the widget-owned pointers to services before session_ destroys |
nothing calls this directly
no test coverage detected