QGIS API Documentation
4.3.0-Master (1c7cf7431bd)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
qgsobjectcustomproperties.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsobjectcustomproperties.h
3
-------------------
4
begin : April 2014
5
copyright : (C) 2014 by Martin Dobias
6
email : wonder.sk at gmail dot com
7
***************************************************************************/
8
9
/***************************************************************************
10
* *
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
15
* *
16
***************************************************************************/
17
18
#ifndef QGSOBJECTCUSTOMPROPERTIES_H
19
#define QGSOBJECTCUSTOMPROPERTIES_H
20
21
#include "qgis_core.h"
22
23
#include <QMap>
24
#include <QVariant>
25
26
class
QDomDocument;
27
class
QDomNode;
28
35
class
CORE_EXPORT
QgsObjectCustomProperties
36
{
37
public
:
38
QgsObjectCustomProperties
() =
default
;
39
43
QStringList
keys
()
const
;
44
50
void
setValue
(
const
QString &key,
const
QVariant &
value
);
51
57
QVariant
value
(
const
QString &key,
const
QVariant &defaultValue = QVariant() )
const
;
58
62
void
remove
(
const
QString &key );
63
69
bool
contains
(
const
QString &key )
const
;
70
78
void
readXml
(
const
QDomNode &parentNode,
const
QString &keyStartsWith = QString() );
79
85
void
writeXml
( QDomNode &parentNode, QDomDocument &doc )
const
;
86
87
protected
:
88
QMap<QString, QVariant>
mMap
;
89
};
90
91
#endif
// QGSOBJECTCUSTOMPROPERTIES_H
QgsObjectCustomProperties::QgsObjectCustomProperties
QgsObjectCustomProperties()=default
QgsObjectCustomProperties::setValue
void setValue(const QString &key, const QVariant &value)
Add an entry to the store with the specified key.
Definition
qgsobjectcustomproperties.cpp:34
QgsObjectCustomProperties::mMap
QMap< QString, QVariant > mMap
Definition
qgsobjectcustomproperties.h:88
QgsObjectCustomProperties::keys
QStringList keys() const
Returns a list of all stored keys.
Definition
qgsobjectcustomproperties.cpp:29
QgsObjectCustomProperties::writeXml
void writeXml(QDomNode &parentNode, QDomDocument &doc) const
Writes the store contents to an XML node.
Definition
qgsobjectcustomproperties.cpp:125
QgsObjectCustomProperties::remove
void remove(const QString &key)
Removes a key (entry) from the store.
Definition
qgsobjectcustomproperties.cpp:44
QgsObjectCustomProperties::value
QVariant value(const QString &key, const QVariant &defaultValue=QVariant()) const
Returns the value for the given key.
Definition
qgsobjectcustomproperties.cpp:39
QgsObjectCustomProperties::readXml
void readXml(const QDomNode &parentNode, const QString &keyStartsWith=QString())
Read store contents from an XML node.
Definition
qgsobjectcustomproperties.cpp:54
QgsObjectCustomProperties::contains
bool contains(const QString &key) const
Returns true if the properties contains a key with the specified name.
Definition
qgsobjectcustomproperties.cpp:49
Generated on
for QGIS API Documentation by
1.17.0