MCPcopy Create free account
hub / github.com/KDE/labplot / hiddenAspectSelected

Method hiddenAspectSelected

src/frontend/GuiObserver.cpp:521–554  ·  view source on GitHub ↗

! 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. */

Source from the content-addressed store, hash-verified

519 -> Activate the corresponding DockWidget and make the title tab current.
520 */
521void 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}

Callers

nothing calls this directly

Calls 3

parentAspectMethod · 0.80
typeMethod · 0.45
activateTitleTabMethod · 0.45

Tested by

no test coverage detected