! handles the selection of a hidden aspect \c aspect in the view (relevant for WorksheetView only at the moment). Currently, a hidden aspect can only be a plot title lable or an axis label. -> Activate the corresponding DockWidget and make the title tab current. */
| 519 | -> Activate the corresponding DockWidget and make the title tab current. |
| 520 | */ |
| 521 | void GuiObserver::hiddenAspectSelected(const AbstractAspect* aspect) { |
| 522 | const AbstractAspect* parent = aspect->parentAspect(); |
| 523 | if (!parent) |
| 524 | return; |
| 525 | |
| 526 | switch (static_cast<quint64>(parent->type())) { // cast the enum to turn off warnings about unhandled cases |
| 527 | case static_cast<quint64>(AspectType::Axis): |
| 528 | if (!m_axisDock) { |
| 529 | m_axisDock = new AxisDock(m_mainWindow->stackedWidget); |
| 530 | initializedDocks << m_axisDock; |
| 531 | m_mainWindow->stackedWidget->addWidget(m_axisDock); |
| 532 | } |
| 533 | m_axisDock->activateTitleTab(); |
| 534 | break; |
| 535 | case static_cast<quint64>(AspectType::CartesianPlot): |
| 536 | if (!m_cartesianPlotDock) { |
| 537 | m_cartesianPlotDock = new CartesianPlotDock(m_mainWindow->stackedWidget); |
| 538 | initializedDocks << m_cartesianPlotDock; |
| 539 | m_mainWindow->stackedWidget->addWidget(m_cartesianPlotDock); |
| 540 | } |
| 541 | m_cartesianPlotDock->activateTitleTab(); |
| 542 | break; |
| 543 | case static_cast<quint64>(AspectType::CartesianPlotLegend): |
| 544 | if (!m_cartesianPlotLegendDock) { |
| 545 | m_cartesianPlotLegendDock = new CartesianPlotLegendDock(m_mainWindow->stackedWidget); |
| 546 | initializedDocks << m_cartesianPlotLegendDock; |
| 547 | m_mainWindow->stackedWidget->addWidget(m_cartesianPlotLegendDock); |
| 548 | } |
| 549 | m_cartesianPlotLegendDock->activateTitleTab(); |
| 550 | break; |
| 551 | default: |
| 552 | break; |
| 553 | } |
| 554 | } |
nothing calls this directly
no test coverage detected