Class: QgsLayerTreeViewDefaultActions

class qgis.gui.QgsLayerTreeViewDefaultActions

Bases: PyQt5.QtCore.QObject

The QgsLayerTreeViewDefaultActions class serves as a factory of actions that can be used together with a layer tree view.

See also

QgsLayerTreeView

Methods

actionAddGroup

param parent

actionCheckAndAllChildren

Action to check a group and all its children

actionCheckAndAllParents

Action to check a group and all its parents

actionGroupSelected

param parent

actionMakeTopLevel

Deprecated since version QGIS: 3.2

actionMoveOutOfGroup

See also

moveOutOfGroup()

actionMoveToBottom

See also

moveToBottom()

actionMoveToTop

See also

moveToTop()

actionMutuallyExclusiveGroup

Action to enable/disable mutually exclusive flag of a group (only one child node may be checked)

actionRemoveGroupOrLayer

param parent

actionRenameGroupOrLayer

param parent

actionShowFeatureCount

param parent

actionShowInOverview

param parent

actionUncheckAndAllChildren

Action to uncheck a group and all its children

actionZoomToGroup

param canvas

actionZoomToLayer

Action to zoom to the active layer from the layer tree.

actionZoomToLayers

Action to zoom to all the selected layer(s) in the layer tree

actionZoomToSelection

Action to zoom to selected features of a vector layer

addGroup

childEvent

connectNotify

customEvent

disconnectNotify

groupSelected

isSignalConnected

makeTopLevel

Deprecated since version QGIS: 3.2

moveOutOfGroup

Moves selected layer(s) out of the group(s) and places this/these above the group(s)

moveToBottom

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.

moveToTop

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.

mutuallyExclusiveGroup

Slot to enable/disable mutually exclusive group flag

receivers

removeGroupOrLayer

renameGroupOrLayer

sender

senderSignalIndex

showFeatureCount

showInOverview

timerEvent

uniqueGroupName

param parentGroup

zoomToGroup

zoomToGroup(self)

zoomToLayer

Zooms a map canvas to the extent of the active layer in the layer tree.

zoomToLayers

Zooms a map canvas to all the selected layer(s) in the layer tree

zoomToSelection

actionAddGroup(self, parent: QObject = None)QAction
Parameters

parent (QObject = None) –

Return type

QAction

actionCheckAndAllChildren(self, parent: QObject = None)QAction

Action to check a group and all its children

Parameters

parent (QObject = None) –

Return type

QAction

actionCheckAndAllParents(self, parent: QObject = None)QAction

Action to check a group and all its parents

Parameters

parent (QObject = None) –

Return type

QAction

actionGroupSelected(self, parent: QObject = None)QAction
Parameters

parent (QObject = None) –

Return type

QAction

actionMakeTopLevel(self, parent: QObject = None)QAction

Deprecated since version QGIS: 3.2 use actionMoveOutOfGroup()

Parameters

parent (QObject = None) –

Return type

QAction

actionMoveOutOfGroup(self, parent: QObject = None)QAction

See also

moveOutOfGroup()

New in version 3.2.

Parameters

parent (QObject = None) –

Return type

QAction

actionMoveToBottom(self, parent: QObject = None)QAction

See also

moveToBottom()

New in version 3.14.

Parameters

parent (QObject = None) –

Return type

QAction

actionMoveToTop(self, parent: QObject = None)QAction

See also

moveToTop()

New in version 3.2.

Parameters

parent (QObject = None) –

Return type

QAction

actionMutuallyExclusiveGroup(self, parent: QObject = None)QAction

Action to enable/disable mutually exclusive flag of a group (only one child node may be checked)

New in version 2.12.

Parameters

parent (QObject = None) –

Return type

QAction

actionRemoveGroupOrLayer(self, parent: QObject = None)QAction
Parameters

parent (QObject = None) –

Return type

QAction

actionRenameGroupOrLayer(self, parent: QObject = None)QAction
Parameters

parent (QObject = None) –

Return type

QAction

actionShowFeatureCount(self, parent: QObject = None)QAction
Parameters

parent (QObject = None) –

Return type

QAction

actionShowInOverview(self, parent: QObject = None)QAction
Parameters

parent (QObject = None) –

Return type

QAction

actionUncheckAndAllChildren(self, parent: QObject = None)QAction

Action to uncheck a group and all its children

Parameters

parent (QObject = None) –

Return type

QAction

actionZoomToGroup(self, canvas: QgsMapCanvas, parent: QObject = None)QAction
Parameters
Return type

QAction

actionZoomToLayer(self, canvas: QgsMapCanvas, parent: QObject = None)QAction

Action to zoom to the active layer from the layer tree.

Deprecated since version QGIS: 3.18 use actionZoomToLayers()

Parameters
Return type

QAction

actionZoomToLayers(self, canvas: QgsMapCanvas, parent: QObject = None)QAction

Action to zoom to all the selected layer(s) in the layer tree

New in version 3.18.

Parameters
Return type

QAction

actionZoomToSelection(self, canvas: QgsMapCanvas, parent: QObject = None)QAction

Action to zoom to selected features of a vector layer

New in version 3.2.

Parameters
Return type

QAction

addGroup(self)
childEvent(self, QChildEvent)
connectNotify(self, QMetaMethod)
customEvent(self, QEvent)
disconnectNotify(self, QMetaMethod)
groupSelected(self)
isSignalConnected(self, QMetaMethod)bool
makeTopLevel(self)

Deprecated since version QGIS: 3.2 use moveOutOfGroup()

moveOutOfGroup(self)

Moves selected layer(s) out of the group(s) and places this/these above the group(s)

New in version 3.2.

moveToBottom(self)

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.

New in version 3.14.

moveToTop(self)

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.

New in version 3.2.

mutuallyExclusiveGroup(self)

Slot to enable/disable mutually exclusive group flag

New in version 2.12.

receivers(self, PYQT_SIGNAL)int
removeGroupOrLayer(self)
renameGroupOrLayer(self)
sender(self)QObject
senderSignalIndex(self)int
showFeatureCount(self)
showInOverview(self)
timerEvent(self, QTimerEvent)
uniqueGroupName(self, parentGroup: QgsLayerTreeGroup)str
Parameters

parentGroup (QgsLayerTreeGroup) –

Return type

str

zoomToGroup(self, canvas: QgsMapCanvas)

zoomToGroup(self)

Parameters

canvas (QgsMapCanvas) –

zoomToLayer(self, canvas: QgsMapCanvas)

Zooms a map canvas to the extent of the active layer in the layer tree.

Deprecated since version QGIS: 3.18 use zoomToLayers()

zoomToLayer(self) Zooms to the extent of the active layer in the layer tree.

Deprecated since version QGIS: 3.18 use zoomToLayers()

Parameters

canvas (QgsMapCanvas) –

zoomToLayers(self, canvas: QgsMapCanvas)

Zooms a map canvas to all the selected layer(s) in the layer tree

See also

zoomToLayers()

New in version 3.18.

zoomToLayers(self) Zooms to the combined extent of all the selected layer(s) in the layer tree.

New in version 3.18.

zoomToLayers(self, canvas: QgsMapCanvas, layers: Iterable[QgsMapLayer])

Parameters

canvas (QgsMapCanvas) –

zoomToSelection(self, canvas: QgsMapCanvas)

New in version 3.2.

zoomToSelection(self) Zooms to the bounding box of all selected features of a vector layer.

New in version 3.2.

Parameters

canvas (QgsMapCanvas) –