MapThemeRecord class
Individual map theme record of visible layers and styles.
Contents
- Reference
Public functions
-
void addLayerRecord(const QgsMapThemeCollection::
MapThemeLayerRecord& record) - Add a new record for a layer.
- auto expandedGroupNodes() const -> QSet<QString>
- Returns a set of group identifiers for group nodes that should have expanded state (other group nodes should be collapsed).
- auto hasExpandedStateInfo() const -> bool
- Returns whether information about expanded/collapsed state of nodes has been recorded and thus whether expandedGroupNodes() and expandedLegendItems + expandedLayerNode from layer records are valid.
-
auto layerRecords() const -> QList<QgsMapThemeCollection::
MapThemeLayerRecord> - Returns a list of records for all visible layer belonging to the theme.
- void removeLayerRecord(QgsMapLayer* layer)
- Removes a record for layer if present.
- void setExpandedGroupNodes(const QSet<QString>& expandedGroupNodes)
- Sets a set of group identifiers for group nodes that should have expanded state.
- 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.
-
auto validLayerRecords() const -> QHash<QgsMapLayer*, QgsMapThemeCollection::
MapThemeLayerRecord> - Returns set with only records for valid layers.
Function documentation
QSet<QString> QgsMapThemeCollection:: MapThemeRecord:: expandedGroupNodes() const
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"
bool QgsMapThemeCollection:: MapThemeRecord:: 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.
void QgsMapThemeCollection:: MapThemeRecord:: setExpandedGroupNodes(const QSet<QString>& expandedGroupNodes)
Sets a set of group identifiers for group nodes that should have expanded state.
See expandedGroupNodes().
void QgsMapThemeCollection:: MapThemeRecord:: setHasExpandedStateInfo(bool hasInfo)
Sets whether the map theme contains valid expanded/collapsed state of nodes.
QHash<QgsMapLayer*, QgsMapThemeCollection:: MapThemeLayerRecord> QgsMapThemeCollection:: MapThemeRecord:: validLayerRecords() const
Returns set with only records for valid layers.