QGIS API Documentation  3.17.0-Master (57c5a6fc26)
Public Slots | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | List of all members
QgsLayerTreeViewDefaultActions Class Reference

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

#include <qgslayertreeviewdefaultactions.h>

Inheritance diagram for QgsLayerTreeViewDefaultActions:
Inheritance graph
[legend]

Public Slots

void addGroup ()
 
void showInOverview ()
 

Public Member Functions

 QgsLayerTreeViewDefaultActions (QgsLayerTreeView *view)
 
QAction * actionAddGroup (QObject *parent=nullptr)
 
QAction * actionCheckAndAllChildren (QObject *parent=nullptr)
 Action to check a group and all its children. More...
 
QAction * actionCheckAndAllParents (QObject *parent=nullptr)
 Action to check a group and all its parents. More...
 
QAction * actionGroupSelected (QObject *parent=nullptr)
 
Q_DECL_DEPRECATED QAction * actionMakeTopLevel (QObject *parent=nullptr)
 
QAction * actionMoveOutOfGroup (QObject *parent=nullptr)
 
QAction * actionMoveToBottom (QObject *parent=nullptr)
 
QAction * actionMoveToTop (QObject *parent=nullptr)
 
QAction * actionMutuallyExclusiveGroup (QObject *parent=nullptr)
 Action to enable/disable mutually exclusive flag of a group (only one child node may be checked) More...
 
QAction * actionRemoveGroupOrLayer (QObject *parent=nullptr)
 
QAction * actionRenameGroupOrLayer (QObject *parent=nullptr)
 
QAction * actionShowFeatureCount (QObject *parent=nullptr)
 
QAction * actionShowInOverview (QObject *parent=nullptr)
 
QAction * actionUncheckAndAllChildren (QObject *parent=nullptr)
 Action to uncheck a group and all its children. More...
 
QAction * actionZoomToGroup (QgsMapCanvas *canvas, QObject *parent=nullptr)
 
Q_DECL_DEPRECATED QAction * actionZoomToLayer (QgsMapCanvas *canvas, QObject *parent=nullptr)
 Action to zoom to the active layer from the layer tree. More...
 
QAction * actionZoomToLayers (QgsMapCanvas *canvas, QObject *parent=nullptr)
 Action to zoom to all the selected layer(s) in the layer tree. More...
 
QAction * actionZoomToSelection (QgsMapCanvas *canvas, QObject *parent=nullptr)
 Action to zoom to selected features of a vector layer. More...
 
void zoomToGroup (QgsMapCanvas *canvas)
 
Q_DECL_DEPRECATED void zoomToLayer (QgsMapCanvas *canvas)
 Zooms a map canvas to the extent of the active layer in the layer tree. More...
 
void zoomToLayers (QgsMapCanvas *canvas)
 Zooms a map canvas to all the selected layer(s) in the layer tree. More...
 
void zoomToSelection (QgsMapCanvas *canvas)
 

Protected Slots

void groupSelected ()
 
Q_DECL_DEPRECATED void makeTopLevel ()
 
void moveOutOfGroup ()
 Moves selected layer(s) out of the group(s) and places this/these above the group(s) More...
 
void 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. More...
 
void 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. More...
 
void mutuallyExclusiveGroup ()
 Slot to enable/disable mutually exclusive group flag. More...
 
void removeGroupOrLayer ()
 
void renameGroupOrLayer ()
 
void showFeatureCount ()
 
void zoomToGroup ()
 
Q_DECL_DEPRECATED void zoomToLayer ()
 Zooms to the extent of the active layer in the layer tree. More...
 
void zoomToLayers ()
 Zooms to the combined extent of all the selected layer(s) in the layer tree. More...
 
void zoomToSelection ()
 Zooms to the bounding box of all selected features of a vector layer. More...
 

Protected Member Functions

QString uniqueGroupName (QgsLayerTreeGroup *parentGroup)
 
void zoomToLayers (QgsMapCanvas *canvas, const QList< QgsMapLayer *> &layers)
 

Protected Attributes

QgsLayerTreeViewmView = nullptr
 

Detailed Description

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

See also
QgsLayerTreeView
Since
QGIS 2.4

Definition at line 39 of file qgslayertreeviewdefaultactions.h.

Constructor & Destructor Documentation

◆ QgsLayerTreeViewDefaultActions()

QgsLayerTreeViewDefaultActions::QgsLayerTreeViewDefaultActions ( QgsLayerTreeView view)

Definition at line 28 of file qgslayertreeviewdefaultactions.cpp.

Member Function Documentation

◆ actionAddGroup()

QAction * QgsLayerTreeViewDefaultActions::actionAddGroup ( QObject *  parent = nullptr)

Definition at line 34 of file qgslayertreeviewdefaultactions.cpp.

◆ actionCheckAndAllChildren()

QAction * QgsLayerTreeViewDefaultActions::actionCheckAndAllChildren ( QObject *  parent = nullptr)

Action to check a group and all its children.

Definition at line 179 of file qgslayertreeviewdefaultactions.cpp.

◆ actionCheckAndAllParents()

QAction * QgsLayerTreeViewDefaultActions::actionCheckAndAllParents ( QObject *  parent = nullptr)

Action to check a group and all its parents.

Definition at line 207 of file qgslayertreeviewdefaultactions.cpp.

◆ actionGroupSelected()

QAction * QgsLayerTreeViewDefaultActions::actionGroupSelected ( QObject *  parent = nullptr)

Definition at line 159 of file qgslayertreeviewdefaultactions.cpp.

◆ actionMakeTopLevel()

QAction * QgsLayerTreeViewDefaultActions::actionMakeTopLevel ( QObject *  parent = nullptr)
Deprecated:
since QGIS 3.2, use actionMoveOutOfGroup()

Definition at line 129 of file qgslayertreeviewdefaultactions.cpp.

◆ actionMoveOutOfGroup()

QAction * QgsLayerTreeViewDefaultActions::actionMoveOutOfGroup ( QObject *  parent = nullptr)
See also
moveOutOfGroup()
Since
QGIS 3.2

Definition at line 138 of file qgslayertreeviewdefaultactions.cpp.

◆ actionMoveToBottom()

QAction * QgsLayerTreeViewDefaultActions::actionMoveToBottom ( QObject *  parent = nullptr)
See also
moveToBottom()
Since
QGIS 3.14

Definition at line 152 of file qgslayertreeviewdefaultactions.cpp.

◆ actionMoveToTop()

QAction * QgsLayerTreeViewDefaultActions::actionMoveToTop ( QObject *  parent = nullptr)
See also
moveToTop()
Since
QGIS 3.2

Definition at line 145 of file qgslayertreeviewdefaultactions.cpp.

◆ actionMutuallyExclusiveGroup()

QAction * QgsLayerTreeViewDefaultActions::actionMutuallyExclusiveGroup ( QObject *  parent = nullptr)

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

Since
QGIS 2.12

Definition at line 166 of file qgslayertreeviewdefaultactions.cpp.

◆ actionRemoveGroupOrLayer()

QAction * QgsLayerTreeViewDefaultActions::actionRemoveGroupOrLayer ( QObject *  parent = nullptr)

Definition at line 41 of file qgslayertreeviewdefaultactions.cpp.

◆ actionRenameGroupOrLayer()

QAction * QgsLayerTreeViewDefaultActions::actionRenameGroupOrLayer ( QObject *  parent = nullptr)

Definition at line 61 of file qgslayertreeviewdefaultactions.cpp.

◆ actionShowFeatureCount()

QAction * QgsLayerTreeViewDefaultActions::actionShowFeatureCount ( QObject *  parent = nullptr)

Definition at line 78 of file qgslayertreeviewdefaultactions.cpp.

◆ actionShowInOverview()

QAction * QgsLayerTreeViewDefaultActions::actionShowInOverview ( QObject *  parent = nullptr)

Definition at line 48 of file qgslayertreeviewdefaultactions.cpp.

◆ actionUncheckAndAllChildren()

QAction * QgsLayerTreeViewDefaultActions::actionUncheckAndAllChildren ( QObject *  parent = nullptr)

Action to uncheck a group and all its children.

Definition at line 193 of file qgslayertreeviewdefaultactions.cpp.

◆ actionZoomToGroup()

QAction * QgsLayerTreeViewDefaultActions::actionZoomToGroup ( QgsMapCanvas canvas,
QObject *  parent = nullptr 
)

Definition at line 120 of file qgslayertreeviewdefaultactions.cpp.

◆ actionZoomToLayer()

QAction * QgsLayerTreeViewDefaultActions::actionZoomToLayer ( QgsMapCanvas canvas,
QObject *  parent = nullptr 
)

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

Deprecated:
since QGIS 3.18, use actionZoomToLayers()

Definition at line 91 of file qgslayertreeviewdefaultactions.cpp.

◆ actionZoomToLayers()

QAction * QgsLayerTreeViewDefaultActions::actionZoomToLayers ( QgsMapCanvas canvas,
QObject *  parent = nullptr 
)

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

Since
QGIS 3.18

Definition at line 102 of file qgslayertreeviewdefaultactions.cpp.

◆ actionZoomToSelection()

QAction * QgsLayerTreeViewDefaultActions::actionZoomToSelection ( QgsMapCanvas canvas,
QObject *  parent = nullptr 
)

Action to zoom to selected features of a vector layer.

Since
QGIS 3.2

Definition at line 111 of file qgslayertreeviewdefaultactions.cpp.

◆ addGroup

void QgsLayerTreeViewDefaultActions::addGroup ( )
slot

Definition at line 241 of file qgslayertreeviewdefaultactions.cpp.

◆ groupSelected

void QgsLayerTreeViewDefaultActions::groupSelected ( )
protectedslot

Definition at line 502 of file qgslayertreeviewdefaultactions.cpp.

◆ makeTopLevel

void QgsLayerTreeViewDefaultActions::makeTopLevel ( )
protectedslot
Deprecated:
since QGIS 3.2, use moveOutOfGroup()

Definition at line 427 of file qgslayertreeviewdefaultactions.cpp.

◆ moveOutOfGroup

void QgsLayerTreeViewDefaultActions::moveOutOfGroup ( )
protectedslot

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

Since
QGIS 3.2

Definition at line 443 of file qgslayertreeviewdefaultactions.cpp.

◆ moveToBottom

void QgsLayerTreeViewDefaultActions::moveToBottom ( )
protectedslot

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.

Since
QGIS 3.14

Definition at line 484 of file qgslayertreeviewdefaultactions.cpp.

◆ moveToTop

void QgsLayerTreeViewDefaultActions::moveToTop ( )
protectedslot

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.

Since
QGIS 3.2

Definition at line 465 of file qgslayertreeviewdefaultactions.cpp.

◆ mutuallyExclusiveGroup

void QgsLayerTreeViewDefaultActions::mutuallyExclusiveGroup ( )
protectedslot

Slot to enable/disable mutually exclusive group flag.

Since
QGIS 2.12

Definition at line 528 of file qgslayertreeviewdefaultactions.cpp.

◆ removeGroupOrLayer

void QgsLayerTreeViewDefaultActions::removeGroupOrLayer ( )
protectedslot

Definition at line 256 of file qgslayertreeviewdefaultactions.cpp.

◆ renameGroupOrLayer

void QgsLayerTreeViewDefaultActions::renameGroupOrLayer ( )
protectedslot

Definition at line 266 of file qgslayertreeviewdefaultactions.cpp.

◆ showFeatureCount

void QgsLayerTreeViewDefaultActions::showFeatureCount ( )
protectedslot

Definition at line 282 of file qgslayertreeviewdefaultactions.cpp.

◆ showInOverview

void QgsLayerTreeViewDefaultActions::showInOverview ( )
slot

Definition at line 271 of file qgslayertreeviewdefaultactions.cpp.

◆ uniqueGroupName()

QString QgsLayerTreeViewDefaultActions::uniqueGroupName ( QgsLayerTreeGroup parentGroup)
protected

Definition at line 417 of file qgslayertreeviewdefaultactions.cpp.

◆ zoomToGroup() [1/2]

void QgsLayerTreeViewDefaultActions::zoomToGroup ( QgsMapCanvas canvas)

Definition at line 326 of file qgslayertreeviewdefaultactions.cpp.

◆ zoomToGroup [2/2]

void QgsLayerTreeViewDefaultActions::zoomToGroup ( )
protectedslot

Definition at line 364 of file qgslayertreeviewdefaultactions.cpp.

◆ zoomToLayer() [1/2]

void QgsLayerTreeViewDefaultActions::zoomToLayer ( QgsMapCanvas canvas)

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

Deprecated:
since QGIS 3.18, use zoomToLayers()

Definition at line 294 of file qgslayertreeviewdefaultactions.cpp.

◆ zoomToLayer [2/2]

void QgsLayerTreeViewDefaultActions::zoomToLayer ( )
protectedslot

Zooms to the extent of the active layer in the layer tree.

Deprecated:
since QGIS 3.18, use zoomToLayers()

Definition at line 340 of file qgslayertreeviewdefaultactions.cpp.

◆ zoomToLayers() [1/3]

void QgsLayerTreeViewDefaultActions::zoomToLayers ( QgsMapCanvas canvas)

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

See also
zoomToLayers()
Since
QGIS 3.18

Definition at line 304 of file qgslayertreeviewdefaultactions.cpp.

◆ zoomToLayers [2/3]

void QgsLayerTreeViewDefaultActions::zoomToLayers ( )
protectedslot

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

Since
QGIS 3.18

Definition at line 350 of file qgslayertreeviewdefaultactions.cpp.

◆ zoomToLayers() [3/3]

void QgsLayerTreeViewDefaultActions::zoomToLayers ( QgsMapCanvas canvas,
const QList< QgsMapLayer *> &  layers 
)
protected

Definition at line 371 of file qgslayertreeviewdefaultactions.cpp.

◆ zoomToSelection() [1/2]

void QgsLayerTreeViewDefaultActions::zoomToSelection ( QgsMapCanvas canvas)
See also
zoomToSelection()
Since
QGIS 3.2

Definition at line 313 of file qgslayertreeviewdefaultactions.cpp.

◆ zoomToSelection [2/2]

void QgsLayerTreeViewDefaultActions::zoomToSelection ( )
protectedslot

Zooms to the bounding box of all selected features of a vector layer.

Since
QGIS 3.2

Definition at line 357 of file qgslayertreeviewdefaultactions.cpp.

Member Data Documentation

◆ mView

QgsLayerTreeView* QgsLayerTreeViewDefaultActions::mView = nullptr
protected

Definition at line 200 of file qgslayertreeviewdefaultactions.h.


The documentation for this class was generated from the following files: