SGSolve
sgpayofftablemodel.hpp
1 // This file is part of the SGSolve library for stochastic games
2 // Copyright (C) 2019 Benjamin A. Brooks
3 //
4 // SGSolve free software: you can redistribute it and/or modify it
5 // under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // SGSolve is distributed in the hope that it will be useful, but
10 // WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see
16 // <http://www.gnu.org/licenses/>.
17 //
18 // Benjamin A. Brooks
19 // ben@benjaminbrooks.net
20 // Chicago, IL
21 
22 #ifndef SGPAYOFFTABLEMODEL_H
23 #define SGPAYOFFTABLEMODEL_H
24 
25 #include <QtWidgets>
26 #include <QMainWindow>
27 #include <QAbstractTableModel>
28 #include <QTableView>
29 #include "sggame.hpp"
30 #include "sgtablemodel.hpp"
31 
33 
42 {
43  Q_OBJECT
44 
45 public:
48  int _state):
49  SGTableModel(_game,_state)
50  {}
51 
53 
56  QVariant data(const QModelIndex & index,
57  int role) const Q_DECL_OVERRIDE;
58 
60 
62  QVariant headerData(int section,
63  Qt::Orientation orientation,
64  int role) const Q_DECL_OVERRIDE;
65 
67 
69  bool setData(const QModelIndex & index, const QVariant & value, int role);
70 
71 }; // SGPayoffTableModel
72 
73 #endif
SGTableModel
Table models for SGViewer.
Definition: sgtablemodel.hpp:39
SGGame
Describes a stochastic game.
Definition: sggame.hpp:40
SGPayoffTableModel::headerData
QVariant headerData(int section, Qt::Orientation orientation, int role) const Q_DECL_OVERRIDE
Returns formatted header data.
Definition: sgpayofftablemodel.cpp:44
SGPayoffTableModel::data
QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE
Returns formatted data.
Definition: sgpayofftablemodel.cpp:25
SGPayoffTableModel
Derived class for payoff table models.
Definition: sgpayofftablemodel.hpp:42
SGPayoffTableModel::setData
bool setData(const QModelIndex &index, const QVariant &value, int role)
Sets data.
Definition: sgpayofftablemodel.cpp:65
SGPayoffTableModel::SGPayoffTableModel
SGPayoffTableModel(SGGame *_game, int _state)
Constructor.
Definition: sgpayofftablemodel.hpp:47