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 unsigned insert_event(uint64_t t, int player_id); // Returns the row.
29 void delete_event(unsigned row);
30 void set_event_type(unsigned row, const std::string &type);
33 unsigned our_score, their_score;
36 unsigned possession_sec;
38 Status get_status_at(uint64_t t);
46 mutable std::map<int, Player> players;
51 std::optional<int> player_id;
54 mutable std::vector<Event> events;
55 mutable bool stale = true;
59 void refresh_if_needed() const;
62 #endif // !defined(_EVENTS_H)