Kata Tournament Runner  0.1.00
 All Classes Namespaces Functions Variables Enumerations Groups Pages
kata_round_participant_model.h
1 #ifndef TOURNAMENT_RUNNER_GUI_KATA_ROUND_PARTICIPANT_MODEL_H
2 #define TOURNAMENT_RUNNER_GUI_KATA_ROUND_PARTICIPANT_MODEL_H
3 
4 #include <memory>
5 #include <vector>
6 #include <cstdint>
7 
8 #include <QtCore/QAbstractTableModel>
9 
10 namespace TournamentRunner
11 {
12 class Tournament;
13 }
14 
15 namespace TournamentRunnerGUI
16 {
17 
25  public QAbstractTableModel
26 {
27  Q_OBJECT
28 
29 public:
30 
39  KataRoundParticipantModel (const uint8_t kata_round,
40  TournamentRunner::Tournament& tournament,
41  std::vector<size_t> startlist,
42  QObject* parent = 0);
46  int rowCount (const QModelIndex& parent = QModelIndex()) const final;
47 
51  int columnCount (const QModelIndex& parent = QModelIndex()) const final;
52 
56  QVariant data (const QModelIndex& index,
57  int role = Qt::DisplayRole) const final;
58 
62  QVariant headerData (int section,
63  Qt::Orientation orientation,
64  int role = Qt::DisplayRole ) const final;
65 
66 private:
67  const uint8_t round_{};
68  TournamentRunner::Tournament& tournament_;
69  std::vector<size_t> startlist_;
70 
71  enum participant_model_column_indices
72  {
73  index_of_name = 0,
74  index_of_score_1,
75  index_of_score_2,
76  index_of_score_3,
77  index_of_score_4,
78  index_of_score_5,
79  index_of_deduction,
80  index_of_overall_score,
81  index_last
82  };
83 
84 };
85 
86 } // namespace TournamentRunnerGUI
87 
88 #endif // TOURNAMENT_RUNNER_GUI_KATA_ROUND_PARTICIPANT_MODEL_H
int columnCount(const QModelIndex &parent=QModelIndex()) const final
Definition: kata_round_participant_model.cpp:30
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const final
Definition: kata_round_participant_model.cpp:35
The Tournament class is the starting point for the tournament management.
Definition: tournament.h:110
The KataRoundParticipantModel class.
Definition: kata_round_participant_model.h:24
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const final
Definition: kata_round_participant_model.cpp:96
KataRoundParticipantModel(const uint8_t kata_round, TournamentRunner::Tournament &tournament, std::vector< size_t > startlist, QObject *parent=0)
KataRoundParticipantModel.
Definition: kata_round_participant_model.cpp:13
int rowCount(const QModelIndex &parent=QModelIndex()) const final
Definition: kata_round_participant_model.cpp:25