Issues pane: Fix filtering

If the parent is visible, we always want to show the child as well.
The previous implementation would always assume the row number to be a
top-level entry, leading to seemingly random behavior if any sort of
filtering was active.
Amends 778d7a9819.

Change-Id: I354c1b07929c45034a7d24b4c31f986ddd01c877
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2023-05-26 17:00:35 +02:00
parent 047814c6da
commit 6a016ff014
2 changed files with 3 additions and 1 deletions

View File

@@ -409,7 +409,8 @@ void TaskFilterModel::updateFilterProperties(
bool TaskFilterModel::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const bool TaskFilterModel::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
{ {
Q_UNUSED(source_parent) if (source_parent.isValid())
return true;
return filterAcceptsTask(taskModel()->tasks().at(source_row)); return filterAcceptsTask(taskModel()->tasks().at(source_row));
} }

View File

@@ -169,6 +169,7 @@ TaskWindow::TaskWindow() : d(std::make_unique<TaskWindowPrivate>())
{ {
d->m_model = new Internal::TaskModel(this); d->m_model = new Internal::TaskModel(this);
d->m_filter = new Internal::TaskFilterModel(d->m_model); d->m_filter = new Internal::TaskFilterModel(d->m_model);
d->m_filter->setAutoAcceptChildRows(true);
auto agg = new Aggregation::Aggregate; auto agg = new Aggregation::Aggregate;
agg->add(&d->m_treeView); agg->add(&d->m_treeView);