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