QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
qgslayertreeviewdefaultactions.h
Go to the documentation of this file.
1/***************************************************************************
2 qgslayertreeviewdefaultactions.h
3 --------------------------------------
4 Date : May 2014
5 Copyright : (C) 2014 by Martin Dobias
6 Email : wonder dot sk at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSLAYERTREEVIEWDEFAULTACTIONS_H
17#define QGSLAYERTREEVIEWDEFAULTACTIONS_H
18
19#include <QObject>
20#include "qgis.h"
21#include "qgis_gui.h"
22
23class QAction;
24
27class QgsMapCanvas;
28class QgsMapLayer;
29
30
39class GUI_EXPORT QgsLayerTreeViewDefaultActions : public QObject
40{
41 Q_OBJECT
42 public:
44
45 QAction *actionAddGroup( QObject *parent = nullptr ) SIP_FACTORY;
46 QAction *actionRemoveGroupOrLayer( QObject *parent = nullptr ) SIP_FACTORY;
47 QAction *actionShowInOverview( QObject *parent = nullptr ) SIP_FACTORY;
48 QAction *actionRenameGroupOrLayer( QObject *parent = nullptr ) SIP_FACTORY;
49 QAction *actionShowFeatureCount( QObject *parent = nullptr ) SIP_FACTORY;
50
52 QAction *actionCheckAndAllChildren( QObject *parent = nullptr );
53
55 QAction *actionUncheckAndAllChildren( QObject *parent = nullptr );
56
58 QAction *actionCheckAndAllParents( QObject *parent = nullptr );
59
64 Q_DECL_DEPRECATED QAction *actionZoomToLayer( QgsMapCanvas *canvas, QObject *parent = nullptr ) SIP_FACTORY SIP_DEPRECATED;
65
70 QAction *actionZoomToLayers( QgsMapCanvas *canvas, QObject *parent = nullptr ) SIP_FACTORY;
71
76 QAction *actionZoomToSelection( QgsMapCanvas *canvas, QObject *parent = nullptr ) SIP_FACTORY;
77 QAction *actionZoomToGroup( QgsMapCanvas *canvas, QObject *parent = nullptr ) SIP_FACTORY;
78
82 Q_DECL_DEPRECATED QAction *actionMakeTopLevel( QObject *parent = nullptr ) SIP_FACTORY;
83
88 QAction *actionMoveOutOfGroup( QObject *parent = nullptr ) SIP_FACTORY;
89
94 QAction *actionMoveToTop( QObject *parent = nullptr ) SIP_FACTORY;
95
100 QAction *actionMoveToBottom( QObject *parent = nullptr ) SIP_FACTORY;
101 QAction *actionGroupSelected( QObject *parent = nullptr ) SIP_FACTORY;
102
107 QAction *actionMutuallyExclusiveGroup( QObject *parent = nullptr ) SIP_FACTORY;
108
113 Q_DECL_DEPRECATED void zoomToLayer( QgsMapCanvas *canvas ) SIP_DEPRECATED;
114
120 void zoomToLayers( QgsMapCanvas *canvas );
121
126 void zoomToSelection( QgsMapCanvas *canvas );
127 void zoomToGroup( QgsMapCanvas *canvas );
128
129 public slots:
130 void showInOverview();
131 void addGroup();
132
133 protected slots:
134 void removeGroupOrLayer();
135 void renameGroupOrLayer();
136 void showFeatureCount();
137
142 Q_DECL_DEPRECATED void zoomToLayer() SIP_DEPRECATED;
143
148 void zoomToLayers();
149
154 void zoomToSelection();
155 void zoomToGroup();
156
160 Q_DECL_DEPRECATED void makeTopLevel() SIP_DEPRECATED;
161
166 void moveOutOfGroup();
167
173 void moveToTop();
174
180 void moveToBottom();
181 void groupSelected();
182
187 void mutuallyExclusiveGroup();
188
189 private slots:
190 void checkAndAllChildren();
191 void uncheckAndAllChildren();
192 void checkAndAllParents();
193
194 protected:
195 void zoomToLayers( QgsMapCanvas *canvas, const QList<QgsMapLayer *> &layers );
196
197 QString uniqueGroupName( QgsLayerTreeGroup *parentGroup );
198
199 protected:
200 QgsLayerTreeView *mView = nullptr;
201};
202
203
204#endif // QGSLAYERTREEVIEWDEFAULTACTIONS_H
Layer tree group node serves as a container for layers and further groups.
The QgsLayerTreeViewDefaultActions class serves as a factory of actions that can be used together wit...
The QgsLayerTreeView class extends QTreeView and provides some additional functionality when working ...
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:90
Base class for all map layer types.
Definition: qgsmaplayer.h:73
#define SIP_DEPRECATED
Definition: qgis_sip.h:106
#define SIP_FACTORY
Definition: qgis_sip.h:76