6 #include <QAbstractTableModel>
11 class EventsModel : public QAbstractTableModel
14 EventsModel(sqlite3 *db) : db(db) {}
16 int rowCount(const QModelIndex &parent) const override
21 int columnCount(const QModelIndex &column) const override
25 QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
26 QVariant data(const QModelIndex &index, int role) const override;
28 int insert_event(uint64_t t, int player_id);
36 mutable std::map<int, Player> players;
40 std::optional<int> player_id;
43 mutable std::vector<Event> events;
44 mutable bool stale = true;
48 void refresh_if_needed() const;
51 #endif // !defined(_EVENTS_H)