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:
Florian Blasius 2022-10-11 18:58:00 +02:00 committed by GitHub
parent 7ec79fb324
commit 129ee0acae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 96 additions and 1 deletions

View file

@ -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(); }