Cute Chess
0.1
projects
gui
src
pgntagsmodel.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 PGN_TAGS_MODEL_H
19
#define PGN_TAGS_MODEL_H
20
21
#include <QAbstractItemModel>
22
#include <QList>
23
#include <QPair>
24
28
class
PgnTagsModel
:
public
QAbstractItemModel
29
{
30
Q_OBJECT
31
32
public
:
34
PgnTagsModel
(
QObject
* parent =
nullptr
);
36
void
setTags
(
const
QList
<
QPair<QString, QString>
>& tags);
37
38
// Inherited from QAbstractItemModel
39
virtual
QModelIndex
index(
int
row,
int
column,
40
const
QModelIndex
& parent =
QModelIndex
())
const
;
41
virtual
QModelIndex
parent(
const
QModelIndex
& index)
const
;
42
virtual
int
rowCount(
const
QModelIndex
& parent =
QModelIndex
())
const
;
43
virtual
int
columnCount(
const
QModelIndex
& parent =
QModelIndex
())
const
;
44
virtual
QVariant
data(
const
QModelIndex
& index,
int
role)
const
;
45
virtual
QVariant
headerData(
int
section, Qt::Orientation orientation,
46
int
role = Qt::DisplayRole)
const
;
47
48
public
slots:
49
void
setTag(
const
QString
& name,
const
QString
& value);
50
51
private
:
52
QList< QPair<QString, QString>
> m_tags;
53
};
54
55
#endif // PGN_TAGS_MODEL_H
QModelIndex
QObject
PgnTagsModel::setTags
void setTags(const QList< QPair< QString, QString > > &tags)
Definition:
pgntagsmodel.cpp:25
QString
QList
QPair
QAbstractItemModel
PgnTagsModel::PgnTagsModel
PgnTagsModel(QObject *parent=nullptr)
Definition:
pgntagsmodel.cpp:20
PgnTagsModel
Supplies PGN tag information to views.
Definition:
pgntagsmodel.h:28
QVariant
Generated by
1.8.14