QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
qgssingleitemmodel.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgssingleitemmodel.h
3
---------------
4
begin : May 2022
5
copyright : (C) 2022 by Nyall Dawson
6
email : nyall dot dawson at gmail dot com
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
16
#ifndef QGSSINGLEITEMMODEL_H
17
#define QGSSINGLEITEMMODEL_H
18
19
#include "qgis_core.h"
20
#include "
qgis_sip.h
"
21
22
#include <QAbstractItemModel>
23
32
class
CORE_EXPORT
QgsSingleItemModel
:
public
QAbstractItemModel
33
{
34
Q_OBJECT
35
36
public
:
45
explicit
QgsSingleItemModel
(
46
QObject *
parent
SIP_TRANSFERTHIS
=
nullptr
,
const
QString &text = QString(),
const
QMap< int, QVariant > &
data
= QMap< int, QVariant >(), Qt::ItemFlags
flags
= Qt::NoItemFlags
47
);
48
57
explicit
QgsSingleItemModel
( QObject *
parent
SIP_TRANSFERTHIS
,
const
QList< QMap< int, QVariant > > &columnData, Qt::ItemFlags
flags
= Qt::NoItemFlags );
58
59
QVariant
data
(
const
QModelIndex &
index
,
int
role )
const override
;
60
Qt::ItemFlags
flags
(
const
QModelIndex &
index
)
const override
;
61
QModelIndex
index
(
int
row,
int
column,
const
QModelIndex &
parent
= QModelIndex() )
const override
;
62
QModelIndex
parent
(
const
QModelIndex &
index
)
const override
;
63
int
rowCount
(
const
QModelIndex &
parent
= QModelIndex() )
const override
;
64
int
columnCount
(
const
QModelIndex &
parent
= QModelIndex() )
const override
;
65
66
private
:
67
QString mText;
68
QMap< int, QVariant > mData;
69
QList< QMap< int, QVariant > > mColumnData;
70
Qt::ItemFlags mFlags = Qt::NoItemFlags;
71
};
72
73
#endif
//QGSSINGLEITEMMODEL_H
QgsSingleItemModel::index
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
Definition
qgssingleitemmodel.cpp:73
QgsSingleItemModel::flags
Qt::ItemFlags flags(const QModelIndex &index) const override
Definition
qgssingleitemmodel.cpp:61
QgsSingleItemModel::columnCount
int columnCount(const QModelIndex &parent=QModelIndex()) const override
Definition
qgssingleitemmodel.cpp:100
QgsSingleItemModel::data
QVariant data(const QModelIndex &index, int role) const override
Definition
qgssingleitemmodel.cpp:33
QgsSingleItemModel::parent
QModelIndex parent(const QModelIndex &index) const override
Definition
qgssingleitemmodel.cpp:86
QgsSingleItemModel::QgsSingleItemModel
QgsSingleItemModel(QObject *parent=nullptr, const QString &text=QString(), const QMap< int, QVariant > &data=QMap< int, QVariant >(), Qt::ItemFlags flags=Qt::NoItemFlags)
Constructor for QgsSingleItemModel with the specified parent object and display text.
Definition
qgssingleitemmodel.cpp:20
QgsSingleItemModel::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Definition
qgssingleitemmodel.cpp:91
qgis_sip.h
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:52
Generated on
for QGIS API Documentation by
1.17.0