QGIS API Documentation  2.8.2-Wien
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | List of all members
QgsMapLayerStyle Class Reference

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

#include <qgsmaplayerstylemanager.h>

Public Member Functions

 QgsMapLayerStyle ()
 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
 Return XML content of the style.

Detailed Description

Stores style information (renderer, transparency, 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.

Note
added in 2.8

Definition at line 36 of file qgsmaplayerstylemanager.h.

Constructor & Destructor Documentation

QgsMapLayerStyle::QgsMapLayerStyle ( )

construct invalid style

Definition at line 204 of file qgsmaplayerstylemanager.cpp.

QgsMapLayerStyle::QgsMapLayerStyle ( const QString &  xmlData)
explicit

construct style from QML definition (XML)

Definition at line 208 of file qgsmaplayerstylemanager.cpp.

Member Function Documentation

void QgsMapLayerStyle::clear ( )

Remove any stored style data (will get invalid)

Definition at line 218 of file qgsmaplayerstylemanager.cpp.

bool QgsMapLayerStyle::isValid ( ) const

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

Definition at line 213 of file qgsmaplayerstylemanager.cpp.

void QgsMapLayerStyle::readFromLayer ( QgsMapLayer layer)

Store layer's active style information in the instance.

Definition at line 228 of file qgsmaplayerstylemanager.cpp.

void QgsMapLayerStyle::readXml ( const QDomElement &  styleElement)

Read style configuration (for project file reading)

Definition at line 260 of file qgsmaplayerstylemanager.cpp.

void QgsMapLayerStyle::writeToLayer ( QgsMapLayer layer) const

Apply stored layer's style information to the layer.

Definition at line 244 of file qgsmaplayerstylemanager.cpp.

void QgsMapLayerStyle::writeXml ( QDomElement &  styleElement) const

Write style configuration (for project file writing)

Definition at line 267 of file qgsmaplayerstylemanager.cpp.

QString QgsMapLayerStyle::xmlData ( ) const

Return XML content of the style.

Definition at line 223 of file qgsmaplayerstylemanager.cpp.


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