Kata Tournament Runner  0.1.00
 All Classes Namespaces Functions Variables Enumerations Groups Pages
participant_model.h
1 #ifndef TOURNAMENT_RUNNER_GUI_PARTICIPANT_MODEL_H
2 #define TOURNAMENT_RUNNER_GUI_PARTICIPANT_MODEL_H
3 
4 #include <QtCore/QAbstractTableModel>
5 
6 namespace TournamentRunner
7 {
8 class Tournament;
9 }
10 
11 namespace TournamentRunnerGUI
12 {
13 
21  public QAbstractTableModel
22 {
23  Q_OBJECT
24 
25 public:
26 
32  explicit ParticipantModel (TournamentRunner::Tournament& tournament,
33  QObject* parent = 0);
38  int rowCount (const QModelIndex& parent = QModelIndex()) const final;
39 
43  int columnCount (const QModelIndex& parent = QModelIndex()) const final;
44 
48  QVariant data (const QModelIndex& index,
49  int role = Qt::DisplayRole) const final;
50 
54  QVariant headerData (int section,
55  Qt::Orientation orientation,
56  int role = Qt::DisplayRole ) const final;
57 
58  bool removeRows(int position, int rows, const QModelIndex &index = QModelIndex()) final;
59 
60  Qt::ItemFlags flags(const QModelIndex &index) const final;
61 
62 private:
63  enum participant_model_column_indices
64  {
65  index_of_name = 0,
66  index_of_surname,
67  index_of_date_of_birth,
68  index_of_dojo,
69  index_of_rank,
70  index_last
71  };
72 
73  TournamentRunner::Tournament& tournament_;
74 
75 
76 };
77 
78 } // namespace TournamentRunnerGUI
79 
80 #endif // TOURNAMENT_RUNNER_GUI_PARTICIPANT_MODEL_H
The ParticipantModel class.
Definition: participant_model.h:20
The Tournament class is the starting point for the tournament management.
Definition: tournament.h:110
int rowCount(const QModelIndex &parent=QModelIndex()) const final
Definition: participant_model.cpp:22
int columnCount(const QModelIndex &parent=QModelIndex()) const final
Definition: participant_model.cpp:27
ParticipantModel(TournamentRunner::Tournament &tournament, QObject *parent=0)
ParticipantModel.
Definition: participant_model.cpp:14
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const final
Definition: participant_model.cpp:77
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const final
Definition: participant_model.cpp:32