QGIS API Documentation  3.0.2-Girona (307d082)
Public Member Functions | List of all members
QgsMapLayerStyle Class Reference

Stores style information (renderer, opacity, labeling, diagrams etc.) applicable to a map layer. More...

#include <qgsmaplayerstylemanager.h>

Public Member Functions

 QgsMapLayerStyle ()=default
 construct invalid style More...
 
 QgsMapLayerStyle (const QString &xmlData)
 construct style from QML definition (XML) More...
 
void clear ()
 Remove any stored style data (will get invalid) More...
 
bool isValid () const
 Tell whether the style is valid (i.e. there is something stored in it) More...
 
void readFromLayer (QgsMapLayer *layer)
 Store layer's active style information in the instance. More...
 
void readXml (const QDomElement &styleElement)
 Read style configuration (for project file reading) More...
 
void writeToLayer (QgsMapLayer *layer) const
 Apply stored layer's style information to the layer. More...
 
void writeXml (QDomElement &styleElement) const
 Write style configuration (for project file writing) More...
 
QString xmlData () const
 Return XML content of the style. More...
 

Detailed Description

Stores style information (renderer, opacity, labeling, diagrams etc.) applicable to a map layer.

Stored data are considered as opaque - it is not possible to access them directly or modify them - it is only possible to read or write layer's current style.

Since
QGIS 2.8

Definition at line 41 of file qgsmaplayerstylemanager.h.

Constructor & Destructor Documentation

◆ QgsMapLayerStyle() [1/2]

QgsMapLayerStyle::QgsMapLayerStyle ( )
default

construct invalid style

◆ QgsMapLayerStyle() [2/2]

QgsMapLayerStyle::QgsMapLayerStyle ( const QString &  xmlData)
explicit

construct style from QML definition (XML)

Definition at line 235 of file qgsmaplayerstylemanager.cpp.

Member Function Documentation

◆ clear()

void QgsMapLayerStyle::clear ( )

Remove any stored style data (will get invalid)

Definition at line 245 of file qgsmaplayerstylemanager.cpp.

◆ isValid()

bool QgsMapLayerStyle::isValid ( ) const

Tell whether the style is valid (i.e. there is something stored in it)

Definition at line 240 of file qgsmaplayerstylemanager.cpp.

◆ readFromLayer()

void QgsMapLayerStyle::readFromLayer ( QgsMapLayer layer)

Store layer's active style information in the instance.

Definition at line 255 of file qgsmaplayerstylemanager.cpp.

◆ readXml()

void QgsMapLayerStyle::readXml ( const QDomElement &  styleElement)

Read style configuration (for project file reading)

Definition at line 292 of file qgsmaplayerstylemanager.cpp.

◆ writeToLayer()

void QgsMapLayerStyle::writeToLayer ( QgsMapLayer layer) const

Apply stored layer's style information to the layer.

Definition at line 271 of file qgsmaplayerstylemanager.cpp.

◆ writeXml()

void QgsMapLayerStyle::writeXml ( QDomElement &  styleElement) const

Write style configuration (for project file writing)

Definition at line 299 of file qgsmaplayerstylemanager.cpp.

◆ xmlData()

QString QgsMapLayerStyle::xmlData ( ) const

Return XML content of the style.

Definition at line 250 of file qgsmaplayerstylemanager.cpp.


The documentation for this class was generated from the following files: