|
QGIS API Documentation 4.1.0-Master (31622b25bb0)
|
Layer tree group node serves as a container for layers and further groups. More...
#include <qgslayertreegroup.h>

Public Member Functions | |
| QgsLayerTreeGroup (const QgsLayerTreeGroup &other) | |
| QgsLayerTreeGroup (const QString &name=QString(), bool checked=true) | |
| Constructor. | |
| void | addChildNode (QgsLayerTreeNode *node) |
| Append an existing node. | |
| QgsLayerTreeCustomNode * | addCustomNode (const QString &id, const QString &name=QString()) |
| Append a new custom node with the given id and name. | |
| QgsLayerTreeGroup * | addGroup (const QString &name) |
| Append a new group node with given name. | |
| QgsLayerTreeLayer * | addLayer (QgsMapLayer *layer) |
| Append a new layer node for given map layer. | |
| QgsLayerTreeGroup * | clone () const override |
| Returns a clone of the group. | |
| QgsGroupLayer * | convertToGroupLayer (const QgsGroupLayer::LayerOptions &options) |
| Converts the group to a QgsGroupLayer. | |
| QString | dump () const override |
| Returns text representation of the tree. | |
| QgsLayerTreeCustomNode * | findCustomNode (const QString &id) const |
| Find custom node representing an object specified by its ID. | |
| QStringList | findCustomNodeIds () const |
| Find custom node IDs. | |
| QgsLayerTreeGroup * | findGroup (const QString &name) |
| Find group node with specified name. | |
| QList< QgsLayerTreeGroup * > | findGroups (bool recursive=false) const |
| Find group layer nodes. | |
| QgsLayerTreeLayer * | findLayer (const QString &layerId) const |
| Find layer node representing the map layer specified by its ID. | |
| QgsLayerTreeLayer * | findLayer (QgsMapLayer *layer) const |
| Find layer node representing the map layer. | |
| QStringList | findLayerIds () const |
| Find layer IDs used in all layer nodes. | |
| QList< QgsLayerTreeLayer * > | findLayers () const |
| Find all layer nodes. | |
| QList< QgsLayerTreeNode * > | findLayersAndCustomNodes () const |
| Find all layer and custom nodes. | |
| QgsGroupLayer * | groupLayer () |
| Returns a reference to the associated group layer, if the layer tree group will be treated as group layer during map rendering. | |
| bool | hasWmsTimeDimension () const |
| Returns whether the WMS time dimension should be computed for this group or not. | |
| void | insertChildNode (int index, QgsLayerTreeNode *node) |
| Insert existing node at specified position. | |
| void | insertChildNodes (int index, const QList< QgsLayerTreeNode * > &nodes) |
| Insert existing nodes at specified position. | |
| QgsLayerTreeCustomNode * | insertCustomNode (int index, const QString &id, const QString &name=QString()) |
| Insert a new custom node with the given id and name at specified index. | |
| QgsLayerTreeCustomNode * | insertCustomNode (int index, QgsLayerTreeCustomNode *node) |
| Insert an existent custom node at specified index. | |
| QgsLayerTreeGroup * | insertGroup (int index, const QString &name) |
| Insert a new group node with given name at specified position. | |
| QgsLayerTreeLayer * | insertLayer (int index, QgsMapLayer *layer) |
| Insert a new layer node for given map layer at specified position. | |
| bool | isMutuallyExclusive () const |
| Returns whether the group is mutually exclusive (only one child can be checked at a time). | |
| QList< QgsLayerTreeNode * > | layerAndCustomNodeOrderRespectingGroupLayers () const |
| Returns an ordered list of map layers and custom nodes in the group, ignoring any layers which are child layers of QgsGroupLayers. | |
| QList< QgsMapLayer * > | layerOrderRespectingGroupLayers () const |
| Returns an ordered list of map layers in the group, ignoring any layers which are child layers of QgsGroupLayers. | |
| QString | name () const override |
| Returns the group's name. | |
| void | readChildrenFromXml (const QDomElement &element, const QgsReadWriteContext &context) |
| Read children from XML and append them to the group. | |
| void | removeAllChildren () |
| Remove all child nodes. | |
| void | removeChildNode (QgsLayerTreeNode *node) |
| Remove a child node from this group. | |
| void | removeChildren (int from, int count) |
| Remove child nodes from index "from". | |
| void | removeChildrenGroupWithoutLayers () |
| Remove all child group nodes without layers. | |
| void | removeCustomNode (QgsLayerTreeCustomNode *customNode) |
| Remove a custom node from this group. | |
| void | removeLayer (QgsMapLayer *layer) |
| Remove map layer's node from this group. | |
| void | reorderGroupLayers (const QList< QgsMapLayer * > &order) |
| Reorders layers in the group to match the order specified by order. | |
| void | reorderGroupLayersAndCustomNodes (const QList< QgsLayerTreeNode * > &order) |
| Reorders layers and custom nodes in the group to match the order specified by order. | |
| void | resolveReferences (const QgsProject *project, bool looseMatching=false) override |
| Calls resolveReferences() on child tree nodes. | |
| QgsMapLayerServerProperties * | serverProperties () |
| Returns QGIS Server Properties for the layer tree group. | |
| const QgsMapLayerServerProperties * | serverProperties () const |
| Returns QGIS Server Properties const for the layer tree group. | |
| void | setGroupLayer (QgsGroupLayer *layer) |
| Sets the associated group layer, if the layer tree group will be treated as group layer during map rendering. | |
| void | setHasWmsTimeDimension (const bool hasWmsTimeDimension) |
| Sets whether the WMS time dimension should be computed for this group or not. | |
| void | setIsMutuallyExclusive (bool enabled, int initialChildIndex=-1) |
| Set whether the group is mutually exclusive (only one child can be checked at a time). | |
| void | setItemVisibilityCheckedRecursive (bool checked) override |
| Check or uncheck a node and all its children (taking into account exclusion rules). | |
| void | setName (const QString &n) override |
| Sets the group's name. | |
| void | setWmsGroupRequestMode (Qgis::WmsGroupRequestMode groupRequestMode) |
| Sets the request mode of the group. | |
| Qgis::WmsGroupRequestMode | wmsGroupRequestMode () const |
| Returns the request mode of the group. | |
| void | writeXml (QDomElement &parentElement, const QgsReadWriteContext &context) override |
| Write group (tree) as XML element <layer-tree-group> and add it to the given parent element. | |
| Public Member Functions inherited from QgsLayerTreeNode | |
| ~QgsLayerTreeNode () override | |
| QList< QgsLayerTreeNode * > | abandonChildren () |
Removes the children, disconnect all the forwarded and external signals and sets their parent to nullptr. | |
| QList< QgsMapLayer * > | checkedLayers () const |
| Returns a list of any checked layers which belong to this node or its children. | |
| QList< QgsLayerTreeNode * > | children () |
| Gets list of children of the node. Children are owned by the parent. | |
| QList< QgsLayerTreeNode * > | children () const |
| Gets list of children of the node. Children are owned by the parent. | |
| QStringList | customProperties () const |
| Returns list of keys stored in custom properties. | |
| QVariant | customProperty (const QString &key, const QVariant &defaultValue=QVariant()) const |
| Read a custom property from layer. Properties are stored in a map and saved in project file. | |
| int | depth () const |
| Returns the depth of this node, i.e. | |
| bool | isExpanded () const |
| Returns whether the node should be shown as expanded or collapsed in GUI. | |
| bool | isItemVisibilityCheckedRecursive () const |
| Returns whether this node is checked and all its children. | |
| bool | isItemVisibilityUncheckedRecursive () const |
| Returns whether this node is unchecked and all its children. | |
| bool | isVisible () const |
| Returns whether a node is really visible (ie checked and all its ancestors checked as well). | |
| bool | itemVisibilityChecked () const |
| Returns whether a node is checked (independently of its ancestors or children). | |
| NodeType | nodeType () const |
| Find out about type of the node. It is usually shorter to use convenience functions from QgsLayerTree namespace for that. | |
| QgsLayerTreeNode * | parent () |
Gets pointer to the parent. If parent is nullptr, the node is a root node. | |
| void | removeCustomProperty (const QString &key) |
| Remove a custom property from layer. Properties are stored in a map and saved in project file. | |
| void | setCustomProperty (const QString &key, const QVariant &value) |
| Sets a custom property for the node. Properties are stored in a map and saved in project file. | |
| void | setExpanded (bool expanded) |
| Sets whether the node should be shown as expanded or collapsed in GUI. | |
| void | setItemVisibilityChecked (bool checked) |
| Check or uncheck a node (independently of its ancestors or children). | |
| void | setItemVisibilityCheckedParentRecursive (bool checked) |
| Check or uncheck a node and all its parents. | |
| bool | takeChild (QgsLayerTreeNode *node) |
| Remove a child from a node. | |
Static Public Member Functions | |
| static QgsLayerTreeGroup * | readXml (const QDomElement &element, const QgsProject *project, const QgsReadWriteContext &context) |
Read group (tree) from XML element <layer-tree-group> and return the newly created group (or nullptr on error). | |
| static QgsLayerTreeGroup * | readXml (const QDomElement &element, const QgsReadWriteContext &context) |
Read group (tree) from XML element <layer-tree-group> and return the newly created group (or nullptr on error). | |
| Static Public Member Functions inherited from QgsLayerTreeNode | |
| static QgsLayerTreeNode * | readXml (QDomElement &element, const QgsProject *project) |
| Read layer tree from XML. | |
| static QgsLayerTreeNode * | readXml (QDomElement &element, const QgsReadWriteContext &context) |
| Read layer tree from XML. | |
Protected Slots | |
| void | nodeVisibilityChanged (QgsLayerTreeNode *node) |
Protected Member Functions | |
| void | makeOrphan () override |
Sets parent to nullptr and disconnects all external and forwarded signals. | |
| void | updateChildVisibilityMutuallyExclusive () |
| Set check state of children - if mutually exclusive. | |
| Protected Member Functions inherited from QgsLayerTreeNode | |
| QgsLayerTreeNode (const QgsLayerTreeNode &other) | |
| QgsLayerTreeNode (NodeType t, bool checked=true) | |
| Constructor. | |
| void | insertChildrenPrivate (int index, const QList< QgsLayerTreeNode * > &nodes) |
| Low-level insertion of children to the node. The children must not have any parent yet! | |
| void | readCommonXml (const QDomElement &element) |
| Read common XML elements. | |
| void | removeChildrenPrivate (int from, int count, bool destroy=true) |
| Low-level removal of children from the node. | |
| void | writeCommonXml (QDomElement &element) |
| Write common XML elements. | |
Protected Attributes | |
| bool | mChangingChildVisibility = false |
| bool | mMutuallyExclusive = false |
| Whether the group is mutually exclusive (i.e. only one child can be checked at a time). | |
| int | mMutuallyExclusiveChildIndex = -1 |
| Keeps track which child has been most recently selected (so if the whole group is unchecked and checked again, we know which child to check). | |
| QString | mName |
| bool | mWmsHasTimeDimension = false |
| Protected Attributes inherited from QgsLayerTreeNode | |
| bool | mChecked |
| QList< QgsLayerTreeNode * > | mChildren |
| list of children - node is responsible for their deletion | |
| bool | mExpanded = true |
| whether the node should be shown in GUI as expanded | |
| NodeType | mNodeType |
| type of the node - determines which subclass is used | |
| QgsLayerTreeNode * | mParent = nullptr |
pointer to the parent node - nullptr in case of root node | |
| QgsObjectCustomProperties | mProperties |
| custom properties attached to the node | |
Additional Inherited Members | |
| Public Types inherited from QgsLayerTreeNode | |
| enum | NodeType { NodeGroup , NodeLayer , NodeCustom } |
| Enumeration of possible tree node types. More... | |
| Signals inherited from QgsLayerTreeNode | |
| void | addedChildren (QgsLayerTreeNode *node, int indexFrom, int indexTo) |
| Emitted when one or more nodes have been added to a node within the tree. | |
| void | customPropertyChanged (QgsLayerTreeNode *node, const QString &key) |
| Emitted when a custom property of a node within the tree has been changed or removed. | |
| void | expandedChanged (QgsLayerTreeNode *node, bool expanded) |
| Emitted when the collapsed/expanded state of a node within the tree has been changed. | |
| void | nameChanged (QgsLayerTreeNode *node, QString name) |
| Emitted when the name of the node is changed. | |
| void | removedChildren (QgsLayerTreeNode *node, int indexFrom, int indexTo) |
| Emitted when one or more nodes has been removed from a node within the tree. | |
| void | visibilityChanged (QgsLayerTreeNode *node) |
| Emitted when check state of a node within the tree has been changed. | |
| void | willAddChildren (QgsLayerTreeNode *node, int indexFrom, int indexTo) |
| Emitted when one or more nodes will be added to a node within the tree. | |
| void | willRemoveChildren (QgsLayerTreeNode *node, int indexFrom, int indexTo) |
| Emitted when one or more nodes will be removed from a node within the tree. | |
Layer tree group node serves as a container for layers and further groups.
Group names do not need to be unique within one tree nor within one parent.
While a layer tree group is typically used for hierarchical organisation of a QgsProject, they can optionally be associated with a QgsGroupLayer for map rendering purposes.
Definition at line 44 of file qgslayertreegroup.h.
| QgsLayerTreeGroup::QgsLayerTreeGroup | ( | const QString & | name = QString(), |
| bool | checked = true ) |
Constructor.
Definition at line 31 of file qgslayertreegroup.cpp.
| QgsLayerTreeGroup::QgsLayerTreeGroup | ( | const QgsLayerTreeGroup & | other | ) |
Definition at line 39 of file qgslayertreegroup.cpp.
| void QgsLayerTreeGroup::addChildNode | ( | QgsLayerTreeNode * | node | ) |
Append an existing node.
The node must not have a parent yet. The node will be owned by this group.
Definition at line 197 of file qgslayertreegroup.cpp.
| QgsLayerTreeCustomNode * QgsLayerTreeGroup::addCustomNode | ( | const QString & | id, |
| const QString & | name = QString() ) |
Append a new custom node with the given id and name.
The newly created node is owned by this group.
Definition at line 145 of file qgslayertreegroup.cpp.
| QgsLayerTreeGroup * QgsLayerTreeGroup::addGroup | ( | const QString & | name | ) |
Append a new group node with given name.
Newly created node is owned by this group.
Definition at line 85 of file qgslayertreegroup.cpp.
| QgsLayerTreeLayer * QgsLayerTreeGroup::addLayer | ( | QgsMapLayer * | layer | ) |
Append a new layer node for given map layer.
The newly created node is owned by this group.
Definition at line 104 of file qgslayertreegroup.cpp.
|
overridevirtual |
Returns a clone of the group.
The children are cloned too.
Implements QgsLayerTreeNode.
Definition at line 631 of file qgslayertreegroup.cpp.
| QgsGroupLayer * QgsLayerTreeGroup::convertToGroupLayer | ( | const QgsGroupLayer::LayerOptions & | options | ) |
Converts the group to a QgsGroupLayer.
This method will convert the layer tree group to an equivalent QgsGroupLayer, and return the result. The caller takes ownership of the returned layer, and it is the caller's responsibility to add the layer to the associated QgsProject.
If the group is already associated with a group layer (see groupLayer()), nullptr will be returned.
Definition at line 701 of file qgslayertreegroup.cpp.
|
overridevirtual |
Returns text representation of the tree.
For debugging purposes only.
Implements QgsLayerTreeNode.
Definition at line 620 of file qgslayertreegroup.cpp.
| QgsLayerTreeCustomNode * QgsLayerTreeGroup::findCustomNode | ( | const QString & | id | ) | const |
Find custom node representing an object specified by its ID.
Searches recursively the whole sub-tree.
Definition at line 334 of file qgslayertreegroup.cpp.
| QStringList QgsLayerTreeGroup::findCustomNodeIds | ( | ) | const |
Find custom node IDs.
Searches recursively the whole sub-tree.
Definition at line 740 of file qgslayertreegroup.cpp.
| QgsLayerTreeGroup * QgsLayerTreeGroup::findGroup | ( | const QString & | name | ) |
Find group node with specified name.
Searches recursively the whole sub-tree.
Definition at line 467 of file qgslayertreegroup.cpp.
| QList< QgsLayerTreeGroup * > QgsLayerTreeGroup::findGroups | ( | bool | recursive = false | ) | const |
Find group layer nodes.
Searches recursively the whole sub-tree, if recursive is set.
Definition at line 487 of file qgslayertreegroup.cpp.
| QgsLayerTreeLayer * QgsLayerTreeGroup::findLayer | ( | const QString & | layerId | ) | const |
Find layer node representing the map layer specified by its ID.
Searches recursively the whole sub-tree.
Definition at line 301 of file qgslayertreegroup.cpp.
| QgsLayerTreeLayer * QgsLayerTreeGroup::findLayer | ( | QgsMapLayer * | layer | ) | const |
Find layer node representing the map layer.
Searches recursively the whole sub-tree.
Definition at line 293 of file qgslayertreegroup.cpp.
| QStringList QgsLayerTreeGroup::findLayerIds | ( | ) | const |
Find layer IDs used in all layer nodes.
Searches recursively the whole sub-tree.
Definition at line 727 of file qgslayertreegroup.cpp.
| QList< QgsLayerTreeLayer * > QgsLayerTreeGroup::findLayers | ( | ) | const |
Find all layer nodes.
Searches recursively the whole sub-tree.
Definition at line 321 of file qgslayertreegroup.cpp.
| QList< QgsLayerTreeNode * > QgsLayerTreeGroup::findLayersAndCustomNodes | ( | ) | const |
Find all layer and custom nodes.
Searches recursively the whole sub-tree.
Definition at line 354 of file qgslayertreegroup.cpp.
| QgsGroupLayer * QgsLayerTreeGroup::groupLayer | ( | ) |
Returns a reference to the associated group layer, if the layer tree group will be treated as group layer during map rendering.
Definition at line 683 of file qgslayertreegroup.cpp.
| bool QgsLayerTreeGroup::hasWmsTimeDimension | ( | ) | const |
Returns whether the WMS time dimension should be computed for this group or not.
if true, when a GetCapabilities request is sent, QGIS server would return a TIME dimension computed as an union of all time dimensions of its children recursively. Else, no TIME dimension will be returned.
Definition at line 870 of file qgslayertreegroup.cpp.
| void QgsLayerTreeGroup::insertChildNode | ( | int | index, |
| QgsLayerTreeNode * | node ) |
Insert existing node at specified position.
The node must not have a parent yet. The node will be owned by this group.
Definition at line 160 of file qgslayertreegroup.cpp.
| void QgsLayerTreeGroup::insertChildNodes | ( | int | index, |
| const QList< QgsLayerTreeNode * > & | nodes ) |
Insert existing nodes at specified position.
The nodes must not have a parent yet. The nodes will be owned by this group.
Definition at line 167 of file qgslayertreegroup.cpp.
| QgsLayerTreeCustomNode * QgsLayerTreeGroup::insertCustomNode | ( | int | index, |
| const QString & | id, | ||
| const QString & | name = QString() ) |
Insert a new custom node with the given id and name at specified index.
The newly created node is owned by this group.
Definition at line 116 of file qgslayertreegroup.cpp.
| QgsLayerTreeCustomNode * QgsLayerTreeGroup::insertCustomNode | ( | int | index, |
| QgsLayerTreeCustomNode * | node ) |
Insert an existent custom node at specified index.
The node must not have a parent yet. The node will be owned by this group.
Definition at line 131 of file qgslayertreegroup.cpp.
| QgsLayerTreeGroup * QgsLayerTreeGroup::insertGroup | ( | int | index, |
| const QString & | name ) |
Insert a new group node with given name at specified position.
The newly created node is owned by this group.
Definition at line 78 of file qgslayertreegroup.cpp.
| QgsLayerTreeLayer * QgsLayerTreeGroup::insertLayer | ( | int | index, |
| QgsMapLayer * | layer ) |
Insert a new layer node for given map layer at specified position.
The newly created node is owned by this group.
Definition at line 92 of file qgslayertreegroup.cpp.
| bool QgsLayerTreeGroup::isMutuallyExclusive | ( | ) | const |
Returns whether the group is mutually exclusive (only one child can be checked at a time).
Definition at line 650 of file qgslayertreegroup.cpp.
| QList< QgsLayerTreeNode * > QgsLayerTreeGroup::layerAndCustomNodeOrderRespectingGroupLayers | ( | ) | const |
Returns an ordered list of map layers and custom nodes in the group, ignoring any layers which are child layers of QgsGroupLayers.
Searches recursively the whole sub-tree.
Definition at line 435 of file qgslayertreegroup.cpp.
| QList< QgsMapLayer * > QgsLayerTreeGroup::layerOrderRespectingGroupLayers | ( | ) | const |
Returns an ordered list of map layers in the group, ignoring any layers which are child layers of QgsGroupLayers.
Searches recursively the whole sub-tree.
Definition at line 407 of file qgslayertreegroup.cpp.
|
overrideprotectedvirtual |
Sets parent to nullptr and disconnects all external and forwarded signals.
Reimplemented from QgsLayerTreeNode.
Definition at line 795 of file qgslayertreegroup.cpp.
|
overridevirtual |
Returns the group's name.
Implements QgsLayerTreeNode.
Definition at line 63 of file qgslayertreegroup.cpp.
|
protectedslot |
Definition at line 753 of file qgslayertreegroup.cpp.
| void QgsLayerTreeGroup::readChildrenFromXml | ( | const QDomElement & | element, |
| const QgsReadWriteContext & | context ) |
Read children from XML and append them to the group.
Does not resolve textual references to layers. Call resolveReferences() afterwards to do it.
Definition at line 604 of file qgslayertreegroup.cpp.
|
static |
Read group (tree) from XML element <layer-tree-group> and return the newly created group (or nullptr on error).
Also resolves textual references to layers from the project (calls resolveReferences() internally).
Definition at line 561 of file qgslayertreegroup.cpp.
|
static |
Read group (tree) from XML element <layer-tree-group> and return the newly created group (or nullptr on error).
Does not resolve textual references to layers. Call resolveReferences() afterwards to do it.
Definition at line 504 of file qgslayertreegroup.cpp.
| void QgsLayerTreeGroup::removeAllChildren | ( | ) |
Remove all child nodes.
The nodes will be deleted.
Definition at line 288 of file qgslayertreegroup.cpp.
| void QgsLayerTreeGroup::removeChildNode | ( | QgsLayerTreeNode * | node | ) |
Remove a child node from this group.
The node will be deleted.
Definition at line 204 of file qgslayertreegroup.cpp.
| void QgsLayerTreeGroup::removeChildren | ( | int | from, |
| int | count ) |
Remove child nodes from index "from".
The nodes will be deleted.
Definition at line 249 of file qgslayertreegroup.cpp.
| void QgsLayerTreeGroup::removeChildrenGroupWithoutLayers | ( | ) |
Remove all child group nodes without layers.
The groupnodes will be deleted.
Definition at line 269 of file qgslayertreegroup.cpp.
| void QgsLayerTreeGroup::removeCustomNode | ( | QgsLayerTreeCustomNode * | customNode | ) |
Remove a custom node from this group.
The node will be deleted.
Definition at line 231 of file qgslayertreegroup.cpp.
| void QgsLayerTreeGroup::removeLayer | ( | QgsMapLayer * | layer | ) |
Remove map layer's node from this group.
The node will be deleted.
Definition at line 213 of file qgslayertreegroup.cpp.
| void QgsLayerTreeGroup::reorderGroupLayers | ( | const QList< QgsMapLayer * > & | order | ) |
Reorders layers in the group to match the order specified by order.
Only layers which are direct children of this group will be reordered, other layers will be ignored.
Definition at line 367 of file qgslayertreegroup.cpp.
| void QgsLayerTreeGroup::reorderGroupLayersAndCustomNodes | ( | const QList< QgsLayerTreeNode * > & | order | ) |
Reorders layers and custom nodes in the group to match the order specified by order.
Only layers and custom nodes which are direct children of this group will be reordered, other layers and custom nodes will be ignored, as well as child group nodes.
Definition at line 387 of file qgslayertreegroup.cpp.
|
overridevirtual |
Calls resolveReferences() on child tree nodes.
Implements QgsLayerTreeNode.
Definition at line 636 of file qgslayertreegroup.cpp.
| QgsMapLayerServerProperties * QgsLayerTreeGroup::serverProperties | ( | ) |
Returns QGIS Server Properties for the layer tree group.
Definition at line 855 of file qgslayertreegroup.cpp.
| const QgsMapLayerServerProperties * QgsLayerTreeGroup::serverProperties | ( | ) | const |
Returns QGIS Server Properties const for the layer tree group.
Definition at line 860 of file qgslayertreegroup.cpp.
| void QgsLayerTreeGroup::setGroupLayer | ( | QgsGroupLayer * | layer | ) |
Sets the associated group layer, if the layer tree group will be treated as group layer during map rendering.
This method does not take ownership of the group layer, and only a weak reference to the layer is stored.
Definition at line 688 of file qgslayertreegroup.cpp.
| void QgsLayerTreeGroup::setHasWmsTimeDimension | ( | const bool | hasWmsTimeDimension | ) |
Sets whether the WMS time dimension should be computed for this group or not.
| hasWmsTimeDimension | if true, when a GetCapabilities request is sent, QGIS server would return a TIME dimension computed as an union of all time dimensions of its children recursively. Else, no TIME dimension will be returned. |
Definition at line 865 of file qgslayertreegroup.cpp.
| void QgsLayerTreeGroup::setIsMutuallyExclusive | ( | bool | enabled, |
| int | initialChildIndex = -1 ) |
Set whether the group is mutually exclusive (only one child can be checked at a time).
The initial child index determines which child should be initially checked. The default value of -1 will determine automatically (either first one currently checked or none)
Definition at line 655 of file qgslayertreegroup.cpp.
|
overridevirtual |
Check or uncheck a node and all its children (taking into account exclusion rules).
Reimplemented from QgsLayerTreeNode.
Definition at line 837 of file qgslayertreegroup.cpp.
|
overridevirtual |
Sets the group's name.
Implements QgsLayerTreeNode.
Definition at line 68 of file qgslayertreegroup.cpp.
| void QgsLayerTreeGroup::setWmsGroupRequestMode | ( | Qgis::WmsGroupRequestMode | groupRequestMode | ) |
Sets the request mode of the group.
| groupRequestMode | On Opaque, WMS treats it as a single opaque layer instead of a collection of individual layers. On Normal it behaves as a standard group. |
Definition at line 880 of file qgslayertreegroup.cpp.
|
protected |
Set check state of children - if mutually exclusive.
Definition at line 776 of file qgslayertreegroup.cpp.
| Qgis::WmsGroupRequestMode QgsLayerTreeGroup::wmsGroupRequestMode | ( | ) | const |
Returns the request mode of the group.
When it's opaque, WMS treats it as a single opaque layer instead of a collection of individual layers. Its child layers are hidden from GetCapabilities requests. Any direct requests (like GetMap or GetFeatureInfo etc.) for a child layer will result in an error. Child layers are rendered whenever a request is made for the group itself.
Definition at line 875 of file qgslayertreegroup.cpp.
|
overridevirtual |
Write group (tree) as XML element <layer-tree-group> and add it to the given parent element.
Implements QgsLayerTreeNode.
Definition at line 572 of file qgslayertreegroup.cpp.
|
protected |
Definition at line 434 of file qgslayertreegroup.h.
|
protected |
Whether the group is mutually exclusive (i.e. only one child can be checked at a time).
Definition at line 437 of file qgslayertreegroup.h.
|
protected |
Keeps track which child has been most recently selected (so if the whole group is unchecked and checked again, we know which child to check).
Definition at line 443 of file qgslayertreegroup.h.
|
protected |
Definition at line 432 of file qgslayertreegroup.h.
|
protected |
Definition at line 445 of file qgslayertreegroup.h.