mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:17:45 +00:00
LibGUI: Support hierarchical matches in FilterProxyModel
Fixes crash when searching in Help. Patch by @eggpi
This commit is contained in:
parent
8825abe7ed
commit
f3d672d53d
1 changed files with 2 additions and 2 deletions
|
@ -41,8 +41,8 @@ Variant FilteringProxyModel::data(ModelIndex const& index, ModelRole role) const
|
|||
if ((size_t)index.row() > m_matching_indices.size() || index.row() < 0)
|
||||
return {};
|
||||
|
||||
// FIXME: Support hierarchical models (with a non-empty index.parent()).
|
||||
auto underlying_index = m_model->index(m_matching_indices[index.row()].row(), index.column(), {});
|
||||
auto matching_index = m_matching_indices[index.row()];
|
||||
auto underlying_index = m_model->index(matching_index.row(), index.column(), matching_index.parent());
|
||||
return underlying_index.data(role);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue