Cute Chess  0.1
engineconfigurationmodel.h
1 /*
2  This file is part of Cute Chess.
3 
4  Cute Chess is free software: you can redistribute it and/or modify
5  it 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  Cute Chess is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with Cute Chess. If not, see <http://www.gnu.org/licenses/>.
16 */
17 
18 #ifndef ENGINE_CONFIGURATION_MODEL_H
19 #define ENGINE_CONFIGURATION_MODEL_H
20 
21 #include <QAbstractListModel>
22 class EngineManager;
23 
24 
43 {
44  Q_OBJECT
45 
46  public:
50  EngineConfigurationModel(EngineManager* engineManager, QObject* parent = nullptr);
52  virtual ~EngineConfigurationModel();
53 
60  QString chessVariant() const;
62  void setChessVariant(const QString& variant);
63 
64  // Inherited from QAbstractListModel
65  virtual int rowCount(const QModelIndex& parent = QModelIndex()) const;
66  virtual int columnCount(const QModelIndex& parent = QModelIndex()) const;
67  virtual QVariant data(const QModelIndex& index, int role) const;
68  virtual QVariant headerData(int section, Qt::Orientation orientation,
69  int role = Qt::DisplayRole) const;
70 
71  private slots:
72  void onEngineAdded(int index);
73  void onEngineAboutToBeRemoved(int index);
74  void onEngineUpdated(int index);
75  void onEnginesReset();
76 
77  private:
78  EngineManager* m_engineManager;
79  QString m_chessVariant;
80 };
81 
82 #endif // ENGINE_CONFIGURATION_MODEL_H
83 
virtual ~EngineConfigurationModel()
Definition: engineconfigurationmodel.cpp:38
Manages chess engines and their configurations.
Definition: enginemanager.h:29
The EngineConfigurationModel class represents a chess engine configuration based model.
Definition: engineconfigurationmodel.h:42
QString chessVariant() const
Definition: engineconfigurationmodel.cpp:42
EngineConfigurationModel(EngineManager *engineManager, QObject *parent=nullptr)
Definition: engineconfigurationmodel.cpp:23
void setChessVariant(const QString &variant)
Definition: engineconfigurationmodel.cpp:47