Apply 'show all' one level deeper. This way it's possible to hide mismatching nets. But the net content is still shown in full detail.

This commit is contained in:
Matthias Koefferlein 2021-09-20 21:24:00 +02:00
parent e14a96a421
commit 4152f10bc4
2 changed files with 5 additions and 5 deletions

View File

@ -3112,7 +3112,7 @@ NetlistBrowserModel::rowCount (const QModelIndex &parent) const
}
void
NetlistBrowserModel::show_or_hide_items (QTreeView *view, const QModelIndex &parent, bool show_all, bool with_warnings, bool with_children)
NetlistBrowserModel::show_or_hide_items (QTreeView *view, const QModelIndex &parent, bool show_all, bool with_warnings, int levels)
{
int n = rowCount (parent);
for (int i = 0; i < n; ++i) {
@ -3123,8 +3123,8 @@ NetlistBrowserModel::show_or_hide_items (QTreeView *view, const QModelIndex &par
bool visible = (show_all || (st != db::NetlistCrossReference::Match && (with_warnings || st != db::NetlistCrossReference::MatchWithWarning)));
view->setRowHidden (int (i), parent, ! visible);
if (visible && with_children) {
show_or_hide_items (view, idx, show_all, with_warnings, false /*just two levels of recursion*/);
if (visible && levels > 1) {
show_or_hide_items (view, idx, show_all, with_warnings, levels - 1);
}
}
@ -3134,7 +3134,7 @@ void
NetlistBrowserModel::set_item_visibility (QTreeView *view, bool show_all, bool with_warnings)
{
// TODO: this implementation is based on the model but is fairly inefficient
show_or_hide_items (view, QModelIndex (), show_all, with_warnings, true);
show_or_hide_items (view, QModelIndex (), show_all, with_warnings, 3);
}
}

View File

@ -373,7 +373,7 @@ private:
return std::pair<const db::Netlist *, const db::Netlist *> (mp_l2ndb->netlist (), (const db::Netlist *)0);
}
void show_or_hide_items (QTreeView *view, const QModelIndex &parent, bool show_all, bool with_warnings, bool with_children);
void show_or_hide_items (QTreeView *view, const QModelIndex &parent, bool show_all, bool with_warnings, int levels);
db::LayoutToNetlist *mp_l2ndb;
db::LayoutVsSchematic *mp_lvsdb;