QGIS API Documentation 3.41.0-Master (3291e9ff48b)
Loading...
Searching...
No Matches
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 <qgsmaplayerstyle.h>

Public Member Functions

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

Detailed Description

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

Stored data are considered as opaque:

Definition at line 41 of file qgsmaplayerstyle.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 28 of file qgsmaplayerstyle.cpp.

Member Function Documentation

◆ clear()

void QgsMapLayerStyle::clear ( )

Remove any stored style data (will get invalid)

Definition at line 38 of file qgsmaplayerstyle.cpp.

◆ isValid()

bool QgsMapLayerStyle::isValid ( ) const

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

Definition at line 33 of file qgsmaplayerstyle.cpp.

◆ readFromLayer()

void QgsMapLayerStyle::readFromLayer ( QgsMapLayer layer)

Store layer's active style information in the instance.

Definition at line 48 of file qgsmaplayerstyle.cpp.

◆ readXml()

void QgsMapLayerStyle::readXml ( const QDomElement &  styleElement)

Read style configuration (for project file reading)

Definition at line 86 of file qgsmaplayerstyle.cpp.

◆ writeToLayer()

void QgsMapLayerStyle::writeToLayer ( QgsMapLayer layer) const

Apply stored layer's style information to the layer.

Definition at line 65 of file qgsmaplayerstyle.cpp.

◆ writeXml()

void QgsMapLayerStyle::writeXml ( QDomElement &  styleElement) const

Write style configuration (for project file writing)

Definition at line 93 of file qgsmaplayerstyle.cpp.

◆ xmlData()

QString QgsMapLayerStyle::xmlData ( ) const

Returns XML content of the style.

Definition at line 43 of file qgsmaplayerstyle.cpp.


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