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

Method aspectSelectedInView

src/backend/core/AspectTreeModel.cpp:534–550  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

532}
533
534void AspectTreeModel::aspectSelectedInView(const AbstractAspect* aspect) {
535 if (aspect->isHidden()) {
536 // a hidden aspect was selected in the view (e.g. plot title in WorksheetView)
537 // select the parent aspect first, if available
538 auto* parent = aspect->parentAspect();
539 if (parent)
540 Q_EMIT indexSelected(modelIndexOfAspect(parent));
541
542 // Q_EMIT also this signal, so the GUI can handle this selection.
543 Q_EMIT hiddenAspectSelected(aspect);
544 } else
545 Q_EMIT indexSelected(modelIndexOfAspect(aspect));
546
547 // deselect the root item when one of the children was selected in the view
548 // in order to avoid multiple selection with the project item (if selected) in the project explorer
549 Q_EMIT indexDeselected(modelIndexOfAspect(m_root));
550}
551
552void AspectTreeModel::aspectDeselectedInView(const AbstractAspect* aspect) {
553 if (aspect->isHidden()) {

Callers

nothing calls this directly

Calls 2

parentAspectMethod · 0.80
isHiddenMethod · 0.45

Tested by

no test coverage detected