forked from qt-creator/qt-creator
Utils: Add a simple way to make a Utils::TreeView searchable
Call setSearchRole(...) to create a suitable find aggregate. Use it in a few places. Change-Id: Iaa663d13bbc7776019e7b18ea720cc2411e0b691 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -172,9 +172,7 @@ TaskWindow::TaskWindow() : d(std::make_unique<TaskWindowPrivate>())
|
||||
d->m_filter = new Internal::TaskFilterModel(d->m_model);
|
||||
d->m_filter->setAutoAcceptChildRows(true);
|
||||
|
||||
auto find = new Core::ItemViewFind(&d->m_treeView, TaskModel::Description);
|
||||
Aggregation::aggregate({&d->m_treeView, find});
|
||||
|
||||
d->m_treeView.setSearchRole(TaskModel::Description);
|
||||
d->m_treeView.setHeaderHidden(true);
|
||||
d->m_treeView.setExpandsOnDoubleClick(false);
|
||||
d->m_treeView.setAlternatingRowColors(true);
|
||||
|
||||
Reference in New Issue
Block a user