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

Method showTopLevelOnly

src/frontend/widgets/TreeViewComboBox.cpp:226–234  ·  view source on GitHub ↗

! Hides the non-toplevel items of the model used in the tree view. */

Source from the content-addressed store, hash-verified

224 Hides the non-toplevel items of the model used in the tree view.
225*/
226void 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.

Callers

nothing calls this directly

Calls 4

rowCountMethod · 0.45
modelMethod · 0.45
indexMethod · 0.45
setRowHiddenMethod · 0.45

Tested by

no test coverage detected