diff options
| author | Timotej Lazar <timotej.lazar@araneo.si> | 2021-09-05 21:16:46 +0200 |
|---|---|---|
| committer | Timotej Lazar <timotej.lazar@araneo.si> | 2021-09-16 20:33:33 +0200 |
| commit | 8d44150598a4e04a751b7df0d8c91ea29099e10e (patch) | |
| tree | 7ff80ba2ea06bd8fa7b1bd0b61298cf86c0f3b85 /event_list.cpp | |
| parent | cb76fedcbc8e419e2b945baa56ac3f986a9e79a3 (diff) | |
Implement filter
Add a proxy model class with filter logic, and use it as the model for
events ListView.
Diffstat (limited to 'event_list.cpp')
| -rw-r--r-- | event_list.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/event_list.cpp b/event_list.cpp index 2654bef..a1e88a5 100644 --- a/event_list.cpp +++ b/event_list.cpp @@ -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; } |
