QGIS API Documentation  3.8.0-Zanzibar (11aff65)
Public Member Functions | Friends | List of all members
QgsMapThemeCollection::MapThemeRecord Class Reference

Individual map theme record of visible layers and styles. More...

#include <qgsmapthemecollection.h>

Public Member Functions

void addLayerRecord (const QgsMapThemeCollection::MapThemeLayerRecord &record)
 Add a new record for a layer. More...
 
QSet< QString > expandedGroupNodes () const
 Returns a set of group identifiers for group nodes that should have expanded state (other group nodes should be collapsed). More...
 
bool hasExpandedStateInfo () const
 Returns whether information about expanded/collapsed state of nodes has been recorded and thus whether expandedGroupNodes() and expandedLegendItems + expandedLayerNode from layer records are valid. More...
 
QList< QgsMapThemeCollection::MapThemeLayerRecordlayerRecords () const
 Returns a list of records for all visible layer belonging to the theme. More...
 
bool operator!= (const QgsMapThemeCollection::MapThemeRecord &other) const
 
bool operator== (const QgsMapThemeCollection::MapThemeRecord &other) const
 
void removeLayerRecord (QgsMapLayer *layer)
 Removes a record for layer if present. More...
 
void setExpandedGroupNodes (const QSet< QString > &expandedGroupNodes)
 Sets a set of group identifiers for group nodes that should have expanded state. More...
 
void setHasExpandedStateInfo (bool hasInfo)
 Sets whether the map theme contains valid expanded/collapsed state of nodes. More...
 
void setLayerRecords (const QList< QgsMapThemeCollection::MapThemeLayerRecord > &records)
 Sets layer records for the theme. More...
 
QHash< QgsMapLayer *, QgsMapThemeCollection::MapThemeLayerRecordvalidLayerRecords () const
 Returns set with only records for valid layers. More...
 

Friends

class QgsMapThemeCollection
 

Detailed Description

Individual map theme record of visible layers and styles.

Since
QGIS 3.0, Previously called PresetRecord

Definition at line 114 of file qgsmapthemecollection.h.

Member Function Documentation

◆ addLayerRecord()

void QgsMapThemeCollection::MapThemeRecord::addLayerRecord ( const QgsMapThemeCollection::MapThemeLayerRecord record)

Add a new record for a layer.

Definition at line 671 of file qgsmapthemecollection.cpp.

◆ expandedGroupNodes()

QSet<QString> QgsMapThemeCollection::MapThemeRecord::expandedGroupNodes ( ) const
inline

Returns a set of group identifiers for group nodes that should have expanded state (other group nodes should be collapsed).

The returned value is valid only when hasExpandedStateInfo() returns true. Group identifiers are built using group names, a sub-group name is prepended by parent group's identifier and a forward slash, e.g. "level1/level2"

Since
QGIS 3.2

Definition at line 166 of file qgsmapthemecollection.h.

◆ hasExpandedStateInfo()

bool QgsMapThemeCollection::MapThemeRecord::hasExpandedStateInfo ( ) const
inline

Returns whether information about expanded/collapsed state of nodes has been recorded and thus whether expandedGroupNodes() and expandedLegendItems + expandedLayerNode from layer records are valid.

Since
QGIS 3.2

Definition at line 151 of file qgsmapthemecollection.h.

◆ layerRecords()

QList<QgsMapThemeCollection::MapThemeLayerRecord> QgsMapThemeCollection::MapThemeRecord::layerRecords ( ) const
inline

Returns a list of records for all visible layer belonging to the theme.

Definition at line 129 of file qgsmapthemecollection.h.

◆ operator!=()

bool QgsMapThemeCollection::MapThemeRecord::operator!= ( const QgsMapThemeCollection::MapThemeRecord other) const
inline

Definition at line 123 of file qgsmapthemecollection.h.

◆ operator==()

bool QgsMapThemeCollection::MapThemeRecord::operator== ( const QgsMapThemeCollection::MapThemeRecord other) const
inline

Definition at line 118 of file qgsmapthemecollection.h.

◆ removeLayerRecord()

void QgsMapThemeCollection::MapThemeRecord::removeLayerRecord ( QgsMapLayer layer)

Removes a record for layer if present.

Definition at line 662 of file qgsmapthemecollection.cpp.

◆ setExpandedGroupNodes()

void QgsMapThemeCollection::MapThemeRecord::setExpandedGroupNodes ( const QSet< QString > &  expandedGroupNodes)
inline

Sets a set of group identifiers for group nodes that should have expanded state.

See expandedGroupNodes().

Since
QGIS 3.2

Definition at line 172 of file qgsmapthemecollection.h.

◆ setHasExpandedStateInfo()

void QgsMapThemeCollection::MapThemeRecord::setHasExpandedStateInfo ( bool  hasInfo)
inline

Sets whether the map theme contains valid expanded/collapsed state of nodes.

Since
QGIS 3.2

Definition at line 157 of file qgsmapthemecollection.h.

◆ setLayerRecords()

void QgsMapThemeCollection::MapThemeRecord::setLayerRecords ( const QList< QgsMapThemeCollection::MapThemeLayerRecord > &  records)
inline

Sets layer records for the theme.

Definition at line 132 of file qgsmapthemecollection.h.

◆ validLayerRecords()

QHash< QgsMapLayer *, QgsMapThemeCollection::MapThemeLayerRecord > QgsMapThemeCollection::MapThemeRecord::validLayerRecords ( ) const

Returns set with only records for valid layers.

Note
not available in Python bindings

Definition at line 676 of file qgsmapthemecollection.cpp.

Friends And Related Function Documentation

◆ QgsMapThemeCollection

friend class QgsMapThemeCollection
friend

Definition at line 187 of file qgsmapthemecollection.h.


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