Kata Tournament Runner  0.1.00
 All Classes Namespaces Functions Variables Enumerations Groups Pages
participant_ranking_model.h
1 #ifndef TOURNAMENT_RUNNER_GUI_PARTICIPANT_RANKING_MODEL_H
2 #define TOURNAMENT_RUNNER_GUI_PARTICIPANT_RANKING_MODEL_H
3 
4 #include <vector>
5 #include <cstdint>
6 #include <QtCore/QAbstractTableModel>
7 
8 #include "tournament_runner/karateka.h"
9 #include "tournament_runner/tournament.h"
10 
12 
13 namespace TournamentRunnerGUI
14 {
15 
23  public QAbstractTableModel
24 {
25  Q_OBJECT
26 
27 public:
28 
35  QObject* parent = 0);
40  int rowCount (const QModelIndex& parent = QModelIndex()) const final;
41 
45  int columnCount (const QModelIndex& parent = QModelIndex()) const final;
46 
50  QVariant data (const QModelIndex& index,
51  int role = Qt::DisplayRole) const final;
52 
56  QVariant headerData (int section,
57  Qt::Orientation orientation,
58  int role = Qt::DisplayRole ) const final;
59 
60 private:
61  enum participant_model_column_indices
62  {
63  index_of_rank = 0,
64  index_of_name,
65  index_overall_score_1,
66  index_min_score_1,
67  index_max_score_1,
68  index_overall_score_2,
69  index_min_score_2,
70  index_max_score_2,
71  index_overall_score_3,
72  index_min_score_3,
73  index_max_score_3,
74  index_last
75  };
76 
77  std::vector<Tournament::RankAnnotatedParticipant> annotated_ranked_list_;
78 };
79 
80 } // namespace TournamentRunnerGUI
81 
82 #endif // TOURNAMENT_RUNNER_GUI_PARTICIPANT_RANKING_MODEL_H
int columnCount(const QModelIndex &parent=QModelIndex()) const final
Definition: participant_ranking_model.cpp:27
The Tournament class is the starting point for the tournament management.
Definition: tournament.h:110
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const final
Definition: participant_ranking_model.cpp:32
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const final
Definition: participant_ranking_model.cpp:111
int rowCount(const QModelIndex &parent=QModelIndex()) const final
Definition: participant_ranking_model.cpp:22
The ParticipantRankingModel.
Definition: participant_ranking_model.h:22
ParticipantRankingModel(TournamentRunner::Tournament &tournament, QObject *parent=0)
ParticipantRankingModel.
Definition: participant_ranking_model.cpp:14