mirror of
https://github.com/slint-ui/slint.git
synced 2025-11-01 20:31:27 +00:00
Florian/sort todo (#1721)
Implement `set_row_data` for `SortModel` and `FilterModel` (rust and cpp). Add sort and filter example to the todo example.
This commit is contained in:
parent
7ec79fb324
commit
129ee0acae
5 changed files with 96 additions and 1 deletions
|
|
@ -967,6 +967,11 @@ public:
|
|||
return inner->source_model->row_data(inner->accepted_rows[i]);
|
||||
}
|
||||
|
||||
void set_row_data(int i, const ModelData &value) override
|
||||
{
|
||||
inner->source_model->set_row_data(inner->accepted_rows[i], value);
|
||||
}
|
||||
|
||||
/// Re-applies the model's filter function on each row of the source model. Use this if state
|
||||
/// external to the filter function has changed.
|
||||
void apply_filter() { inner->reset(); }
|
||||
|
|
@ -1206,6 +1211,11 @@ public:
|
|||
return inner->source_model->row_data(inner->sorted_rows[i]);
|
||||
}
|
||||
|
||||
void set_row_data(int i, const ModelData &value) override
|
||||
{
|
||||
inner->source_model->set_row_data(inner->sorted_rows[i], value);
|
||||
}
|
||||
|
||||
/// Re-applies the model's sort function on each row of the source model. Use this if state
|
||||
/// external to the sort function has changed.
|
||||
void sort() { inner->reset(); }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue