2 #define _FORMATIONS_H 1
5 #include <QAbstractListModel>
9 class FormationsModel : public QAbstractListModel
12 FormationsModel(sqlite3 *db, bool offense);
14 int rowCount(const QModelIndex &parent) const override
16 return formations.size() + 2;
18 QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
19 QVariant data(const QModelIndex &index, int role) const override;
21 int get_formation_id(unsigned row) const {
25 if (row == formations.size() + 1) {
28 return formations[row - 1].formation_id;
30 std::string get_formation_name_by_id(unsigned formation_id);
37 std::vector<Formation> formations;
45 #endif // !defined(_FORMATIONS_H)