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
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue