QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
Public Member Functions | Static 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.
 
QSet< QString > checkedGroupNodes () const
 Returns a set of group identifiers for group nodes that should have checked state (other group nodes should be unchecked).
 
QSet< QString > expandedGroupNodes () const
 Returns a set of group identifiers for group nodes that should have expanded state (other group nodes should be collapsed).
 
bool hasCheckedStateInfo () const
 Returns whether information about checked/unchecked state of groups has been recorded and thus whether checkedGroupNodes() is valid.
 
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.
 
QList< QgsMapThemeCollection::MapThemeLayerRecordlayerRecords () const
 Returns a list of records for all visible layer belonging to the theme.
 
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.
 
void setCheckedGroupNodes (const QSet< QString > &checkedGroupNodes)
 Sets a set of group identifiers for group nodes that should have checked state.
 
void setExpandedGroupNodes (const QSet< QString > &expandedGroupNodes)
 Sets a set of group identifiers for group nodes that should have expanded state.
 
void setHasCheckedStateInfo (bool hasInfo)
 Sets whether the map theme contains valid checked/unchecked state of group nodes.
 
void setHasExpandedStateInfo (bool hasInfo)
 Sets whether the map theme contains valid expanded/collapsed state of nodes.
 
void setLayerRecords (const QList< QgsMapThemeCollection::MapThemeLayerRecord > &records)
 Sets layer records for the theme.
 
QHash< QgsMapLayer *, QgsMapThemeCollection::MapThemeLayerRecordvalidLayerRecords () const
 Returns set with only records for valid layers.
 
void writeXml (QDomElement element, QDomDocument &document) const
 Writes the map theme record to XML.
 

Static Public Member Functions

static MapThemeRecord readXml (const QDomElement &element, const QgsProject *project)
 Reads the map theme record from XML.
 

Friends

class QgsMapThemeCollection
 

Detailed Description

Individual map theme record of visible layers and styles.

Definition at line 119 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 549 of file qgsmapthemecollection.cpp.

◆ checkedGroupNodes()

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

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

The returned value is valid only when hasCheckedStateInfo() 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.10.1

Definition at line 193 of file qgsmapthemecollection.h.

◆ 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 184 of file qgsmapthemecollection.h.

◆ hasCheckedStateInfo()

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

Returns whether information about checked/unchecked state of groups has been recorded and thus whether checkedGroupNodes() is valid.

Since
QGIS 3.10.1

Definition at line 163 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 156 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 135 of file qgsmapthemecollection.h.

◆ operator!=()

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

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.

◆ readXml()

QgsMapThemeCollection::MapThemeRecord QgsMapThemeCollection::MapThemeRecord::readXml ( const QDomElement &  element,
const QgsProject project 
)
static

Reads the map theme record from XML.

Parameters
elementDOM element
projectthe QGIS project
See also
writeXml
Since
QGIS 3.42

Definition at line 565 of file qgsmapthemecollection.cpp.

◆ removeLayerRecord()

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

Removes a record for layer if present.

Definition at line 540 of file qgsmapthemecollection.cpp.

◆ setCheckedGroupNodes()

void QgsMapThemeCollection::MapThemeRecord::setCheckedGroupNodes ( const QSet< QString > &  checkedGroupNodes)
inline

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

See checkedGroupNodes().

Since
QGIS 3.10.1

Definition at line 205 of file qgsmapthemecollection.h.

◆ 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 199 of file qgsmapthemecollection.h.

◆ setHasCheckedStateInfo()

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

Sets whether the map theme contains valid checked/unchecked state of group nodes.

Since
QGIS 3.10.1

Definition at line 175 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 169 of file qgsmapthemecollection.h.

◆ setLayerRecords()

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

Sets layer records for the theme.

Definition at line 138 of file qgsmapthemecollection.h.

◆ validLayerRecords()

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

Returns set with only records for valid layers.

Definition at line 554 of file qgsmapthemecollection.cpp.

◆ writeXml()

void QgsMapThemeCollection::MapThemeRecord::writeXml ( QDomElement  element,
QDomDocument &  document 
) const

Writes the map theme record to XML.

Parameters
elementDOM element
documentDOM document
See also
readXml
Since
QGIS 3.42

Definition at line 682 of file qgsmapthemecollection.cpp.

Friends And Related Symbol Documentation

◆ QgsMapThemeCollection

friend class QgsMapThemeCollection
friend

Definition at line 246 of file qgsmapthemecollection.h.


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