! Hides the non-toplevel items of the model used in the tree view. */
| 224 | Hides the non-toplevel items of the model used in the tree view. |
| 225 | */ |
| 226 | void TreeViewComboBox::showTopLevelOnly(const QModelIndex& index) { |
| 227 | int rows = index.model()->rowCount(index); |
| 228 | for (int i = 0; i < rows; i++) { |
| 229 | QModelIndex child = index.model()->index(i, 0, index); |
| 230 | showTopLevelOnly(child); |
| 231 | const auto* aspect = static_cast<const AbstractAspect*>(child.internalPointer()); |
| 232 | m_treeView->setRowHidden(i, index, !(isTopLevel(aspect) && !isHidden(aspect))); |
| 233 | } |
| 234 | } |
| 235 | |
| 236 | /*! |
| 237 | catches the MouseButtonPress-event and hides the tree view on mouse clicking. |
nothing calls this directly
no test coverage detected