Change Model::row_data to return an Option<T> (#873)

Change Model::row_data to return an Option<T> (rust) or std::optional<T> (c++)

Co-authored-by: Olivier Goffart <olivier@woboq.com>
Co-authored-by: Simon Hausmann <hausmann@gmail.com>
This commit is contained in:
Tobias Hunger 2022-01-26 13:55:38 +01:00 committed by GitHub
parent e2ec76f9ef
commit e3c4209b1f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 229 additions and 102 deletions

View file

@ -27,7 +27,7 @@ int main()
int offset = 0;
int count = todo_model->row_count();
for (int i = 0; i < count; ++i) {
if (todo_model->row_data(i - offset).checked) {
if (todo_model->row_data(i - offset)->checked) {
todo_model->erase(i - offset);
offset += 1;
}