Implement filter
Add a proxy model class with filter logic, and use it as the model for events ListView.
This commit is contained in:
parent
cb76fedcbc
commit
8d44150598
6 changed files with 144 additions and 12 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue