QGIS API Documentation
3.14.0-Pi (9f7028fd23)
src
core
qgsmaplayerstyle.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsmaplayersty.h
3
--------------------------------------
4
Date : September 2019
5
Copyright : (C) 2018 by Denis Rouzaud
6
Email :
[email protected]
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 QGSMAPLAYERSTYLE_H
17
#define QGSMAPLAYERSTYLE_H
18
19
#include "qgis_core.h"
20
#include "
qgis_sip.h
"
21
22
#include <QByteArray>
23
#include <QMap>
24
#include <QStringList>
25
#include <QObject>
26
27
28
class
QDomElement;
29
class
QgsMapLayer
;
30
42
class
CORE_EXPORT
QgsMapLayerStyle
43
{
44
public
:
46
QgsMapLayerStyle
() =
default
;
47
49
explicit
QgsMapLayerStyle
(
const
QString &xmlData );
50
52
bool
isValid()
const
;
53
55
void
clear();
56
58
QString xmlData()
const
;
59
61
void
readFromLayer(
QgsMapLayer
*layer );
63
void
writeToLayer(
QgsMapLayer
*layer )
const
;
64
66
void
readXml(
const
QDomElement &styleElement );
68
void
writeXml( QDomElement &styleElement )
const
;
69
70
private
:
71
QString mXmlData;
72
};
73
74
81
class
CORE_EXPORT
QgsMapLayerStyleOverride
82
{
83
public
:
84
89
QgsMapLayerStyleOverride
(
QgsMapLayer
*layer )
90
: mLayer( layer )
91
{
92
}
93
94
~
QgsMapLayerStyleOverride
();
95
100
void
setOverrideStyle(
const
QString &style );
101
102
private
:
103
104
QgsMapLayer
*mLayer =
nullptr
;
105
bool
mStyleOverridden =
false
;
106
};
107
#endif // QGSMAPLAYERSTYLE_H
QgsMapLayerStyleOverride::QgsMapLayerStyleOverride
QgsMapLayerStyleOverride(QgsMapLayer *layer)
Construct a style override object associated with a map layer.
Definition:
qgsmaplayerstyle.h:89
QgsMapLayerStyleOverride
Definition:
qgsmaplayerstyle.h:81
qgis_sip.h
QgsMapLayer
Definition:
qgsmaplayer.h:81
QgsMapLayerStyle
Definition:
qgsmaplayerstyle.h:42
Generated on Mon Jun 22 2020 05:14:09 for QGIS API Documentation by
1.8.17