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

@ -20,8 +20,8 @@ public:
bool setData(const QModelIndex& index, const QVariant& value, int role);
public slots:
int insert(const int time = -1);
bool removeRows(int row, int count = 1, const QModelIndex &parent = {});
int insert(const QString& tag = {}, const int time = -1);
bool removeRows(int row, int count = 1, const QModelIndex& parent = {});
void load(const QJsonObject& json);
QJsonObject save() const;
@ -36,8 +36,8 @@ private:
};
enum Role { Time = Qt::UserRole + 1, Tag, Values };
QStringList tagsOrder;
QJsonObject tags;
QStringList tagsOrder;
QList<Event> events;
int find(long long time) const;