| 532 | } |
| 533 | |
| 534 | void 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 | |
| 552 | void AspectTreeModel::aspectDeselectedInView(const AbstractAspect* aspect) { |
| 553 | if (aspect->isHidden()) { |
nothing calls this directly
no test coverage detected