5 #include <QAbstractTableModel>
9 class PlayersModel : public QAbstractTableModel
12 PlayersModel(sqlite3 *db);
14 int rowCount(const QModelIndex &parent) const override
16 return players.size();
18 int columnCount(const QModelIndex &column) const override
22 QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
23 QVariant data(const QModelIndex &index, int role) const override;
25 int get_player_id(unsigned row) const {
26 return players[row].player_id;
28 std::string get_player_name_by_id(unsigned player_id);
37 std::vector<Player> players;
44 #endif // !defined(_PLAYERS_H)