forked from qt-creator/qt-creator
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:
@@ -409,7 +409,8 @@ void TaskFilterModel::updateFilterProperties(
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
|
||||
@@ -169,6 +169,7 @@ TaskWindow::TaskWindow() : d(std::make_unique<TaskWindowPrivate>())
|
||||
{
|
||||
d->m_model = new Internal::TaskModel(this);
|
||||
d->m_filter = new Internal::TaskFilterModel(d->m_model);
|
||||
d->m_filter->setAutoAcceptChildRows(true);
|
||||
|
||||
auto agg = new Aggregation::Aggregate;
|
||||
agg->add(&d->m_treeView);
|
||||
|
||||
Reference in New Issue
Block a user