Class: QgsLayerTreeViewDefaultActions¶
The QgsLayerTreeViewDefaultActions class serves as a factory
of actions that can be used together with a layer tree view.
See also
Class Hierarchy¶
Base classes¶
- class qgis.gui.QgsLayerTreeViewDefaultActions[source]¶
Bases:
QObject- actionAddGroup(self, parent: QObject | None = None) QAction | None[source]¶
- Parameters:
parent (Optional[QObject] = None)
- Return type:
Optional[QAction]
- actionCheckAndAllChildren(self, parent: QObject | None = None) QAction | None[source]¶
Action to check a group and all its children
- Parameters:
parent (Optional[QObject] = None)
- Return type:
Optional[QAction]
- actionCheckAndAllParents(self, parent: QObject | None = None) QAction | None[source]¶
Action to check a group and all its parents
- Parameters:
parent (Optional[QObject] = None)
- Return type:
Optional[QAction]
- actionGroupSelected(self, parent: QObject | None = None) QAction | None[source]¶
- Parameters:
parent (Optional[QObject] = None)
- Return type:
Optional[QAction]
- actionMakeTopLevel(self, parent: QObject | None = None) QAction | None[source]¶
Deprecated since version 3.2.
- Parameters:
parent (Optional[QObject] = None)
- Return type:
Optional[QAction]
- actionMoveOutOfGroup(self, parent: QObject | None = None) QAction | None[source]¶
See also
Added in version 3.2.
- Parameters:
parent (Optional[QObject] = None)
- Return type:
Optional[QAction]
- actionMoveToBottom(self, parent: QObject | None = None) QAction | None[source]¶
See also
Added in version 3.14.
- Parameters:
parent (Optional[QObject] = None)
- Return type:
Optional[QAction]
- actionMoveToTop(self, parent: QObject | None = None) QAction | None[source]¶
See also
Added in version 3.2.
- Parameters:
parent (Optional[QObject] = None)
- Return type:
Optional[QAction]
- actionMutuallyExclusiveGroup(self, parent: QObject | None = None) QAction | None[source]¶
Action to enable/disable mutually exclusive flag of a group (only one child node may be checked)
- Parameters:
parent (Optional[QObject] = None)
- Return type:
Optional[QAction]
- actionRemoveGroupOrLayer(self, parent: QObject | None = None) QAction | None[source]¶
- Parameters:
parent (Optional[QObject] = None)
- Return type:
Optional[QAction]
- actionRenameGroupOrLayer(self, parent: QObject | None = None) QAction | None[source]¶
- Parameters:
parent (Optional[QObject] = None)
- Return type:
Optional[QAction]
- actionShowFeatureCount(self, parent: QObject | None = None) QAction | None[source]¶
- Parameters:
parent (Optional[QObject] = None)
- Return type:
Optional[QAction]
- actionShowInOverview(self, parent: QObject | None = None) QAction | None[source]¶
- Parameters:
parent (Optional[QObject] = None)
- Return type:
Optional[QAction]
- actionUncheckAndAllChildren(self, parent: QObject | None = None) QAction | None[source]¶
Action to uncheck a group and all its children
- Parameters:
parent (Optional[QObject] = None)
- Return type:
Optional[QAction]
- actionZoomToGroup(self, canvas: QgsMapCanvas | None, parent: QObject | None = None) QAction | None[source]¶
- Parameters:
canvas (Optional[QgsMapCanvas])
parent (Optional[QObject] = None)
- Return type:
Optional[QAction]
- actionZoomToLayer(self, canvas: QgsMapCanvas | None, parent: QObject | None = None) QAction | None[source]¶
Action to zoom to the active layer from the layer tree.
Deprecated since version 3.18: Use
actionZoomToLayers().- Parameters:
canvas (Optional[QgsMapCanvas])
parent (Optional[QObject] = None)
- Return type:
Optional[QAction]
- actionZoomToLayers(self, canvas: QgsMapCanvas | None, parent: QObject | None = None) QAction | None[source]¶
Action to zoom to all the selected layer(s) in the layer tree
Added in version 3.18.
- Parameters:
canvas (Optional[QgsMapCanvas])
parent (Optional[QObject] = None)
- Return type:
Optional[QAction]
- actionZoomToSelection(self, canvas: QgsMapCanvas | None, parent: QObject | None = None) QAction | None[source]¶
Action to zoom to selected features of a vector layer
Added in version 3.2.
- Parameters:
canvas (Optional[QgsMapCanvas])
parent (Optional[QObject] = None)
- Return type:
Optional[QAction]
- makeTopLevel(self)[source]¶
Deprecated since version 3.2.
Use
moveOutOfGroup().
- moveOutOfGroup(self)[source]¶
Moves selected layer(s) out of the group(s) and places this/these above the group(s)
Added in version 3.2.
- moveToBottom(self)[source]¶
Moves selected layer(s) and/or group(s) to the bottom of the layer panel or the bottom of the group if the layer/group is placed within a group.
Added in version 3.14.
- moveToTop(self)[source]¶
Moves selected layer(s) and/or group(s) to the top of the layer panel or the top of the group if the layer/group is placed within a group.
Added in version 3.2.
- uniqueGroupName(self, parentGroup: QgsLayerTreeGroup | None) str[source]¶
- Parameters:
parentGroup (Optional[QgsLayerTreeGroup])
- Return type:
str
- zoomToGroup(self, canvas: QgsMapCanvas | None)[source]¶
- zoomToGroup(self)
- Parameters:
canvas (Optional[QgsMapCanvas])
- zoomToLayer(self, canvas: QgsMapCanvas | None)[source]¶
Zooms a map
canvasto the extent of the active layer in the layer tree.Deprecated since version 3.18: Use
zoomToLayers().zoomToLayer(self) Zooms to the extent of the active layer in the layer tree.
Deprecated since version 3.18: Use
zoomToLayers().- Parameters:
canvas (Optional[QgsMapCanvas])
- zoomToLayers(self, canvas: QgsMapCanvas | None)[source]¶
Zooms a map
canvasto all the selected layer(s) in the layer treeSee also
Added in version 3.18.
zoomToLayers(self) Zooms to the combined extent of all the selected layer(s) in the layer tree.
Added in version 3.18.
zoomToLayers(self, canvas: Optional[QgsMapCanvas], layers: Iterable[QgsMapLayer])
- Parameters:
canvas (Optional[QgsMapCanvas])
- zoomToSelection(self, canvas: QgsMapCanvas | None)[source]¶
See also
Added in version 3.2.
zoomToSelection(self) Zooms to the bounding box of all selected features of a vector layer.
Added in version 3.2.
- Parameters:
canvas (Optional[QgsMapCanvas])