QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
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 <QMap>
22 #include <QVariant>
23 
24 class QDomDocument;
25 class QDomNode;
26 
33 class CORE_EXPORT QgsObjectCustomProperties
34 {
35  public:
37 
39  QStringList keys() const;
40 
42  void setValue( const QString& key, const QVariant& value );
43 
45  QVariant value( const QString& key, const QVariant& defaultValue = QVariant() ) const;
46 
48  void remove( const QString& key );
49 
50 
55  void readXml( const QDomNode& parentNode, const QString& keyStartsWith = QString() );
56 
58  void writeXml( QDomNode& parentNode, QDomDocument& doc ) const;
59 
60 
61  protected:
63 
64 };
65 
66 #endif // QGSOBJECTCUSTOMPROPERTIES_H
QMap< QString, QVariant > mMap
Simple key-value store (keys = strings, values = variants) that supports loading/saving to/from XML i...