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()

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

param canvas

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)

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

zoomToLayer(self)

zoomToLayers

param canvas

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

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
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()
connectNotify()
customEvent()
disconnectNotify()
groupSelected(self)
isSignalConnected()
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.

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()
removeGroupOrLayer(self)
renameGroupOrLayer(self)
sender()
senderSignalIndex()
showFeatureCount(self)
showInOverview(self)
timerEvent()
uniqueGroupName(self, parentGroup: QgsLayerTreeGroup) → str
Parameters

parentGroup (QgsLayerTreeGroup) –

Return type

str

zoomToGroup(self, canvas: QgsMapCanvas)

zoomToGroup(self)

Parameters

canvas (QgsMapCanvas) –

zoomToLayer(self, canvas: QgsMapCanvas)

zoomToLayer(self)

Parameters

canvas (QgsMapCanvas) –

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

New in version 3.2.

zoomToSelection(self) Slot to zoom to selected features of a vector layer

New in version 3.2.

Parameters

canvas (QgsMapCanvas) –