Cute Chess 0.1
engineoptionmodel.h
1/*
2 This file is part of Cute Chess.
3 Copyright (C) 2008-2018 Cute Chess authors
4
5 Cute Chess is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 Cute Chess is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with Cute Chess. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#ifndef ENGINE_OPTION_MODEL_H
20#define ENGINE_OPTION_MODEL_H
21
22#include <QAbstractItemModel>
23
24class EngineOption;
25
26class EngineOptionModel : public QAbstractItemModel
27{
28 Q_OBJECT
29
30 public:
31 EngineOptionModel(QObject* parent = nullptr);
32 EngineOptionModel(QList<EngineOption*> options, QObject* parent = nullptr);
33
34 void setOptions(const QList<EngineOption*>& options);
35
36 // Inherited from QAbstractItemModel
37 virtual QModelIndex index(int row, int column,
38 const QModelIndex& parent = QModelIndex()) const;
39 virtual QModelIndex parent(const QModelIndex& index) const;
40 virtual int rowCount(const QModelIndex& parent = QModelIndex()) const;
41 virtual int columnCount(const QModelIndex& parent = QModelIndex()) const;
42 virtual QVariant data(const QModelIndex& index, int role) const;
43 virtual QVariant headerData(int section, Qt::Orientation orientation,
44 int role = Qt::DisplayRole) const;
45 virtual Qt::ItemFlags flags(const QModelIndex& index) const;
46 virtual bool setData(const QModelIndex& index, const QVariant& value,
47 int role = Qt::EditRole);
48
49 private:
50 QList<EngineOption*> m_options;
51};
52
53#endif // ENGINE_OPTION_MODEL_H
Definition engineoption.h:26