Implement filter

Add a proxy model class with filter logic, and use it as the model for
events ListView.
This commit is contained in:
Timotej Lazar 2021-09-05 21:16:46 +02:00
parent cb76fedcbc
commit 8d44150598
No known key found for this signature in database
GPG key ID: B6F38793D143456F
6 changed files with 144 additions and 12 deletions

View file

@ -58,11 +58,11 @@ bool EventList::setData(const QModelIndex& index, const QVariant& value, int rol
return true;
}
int EventList::insert(const int time)
int EventList::insert(const QString& tag, const int time)
{
int row = time == -1 ? rowCount() : find(time);
beginInsertRows(QModelIndex{}, row, row);
events.insert(row, {time});
events.insert(row, {time, tag});
endInsertRows();
return row;
}