QGIS API Documentation 3.43.0-Master (c67cf405802)
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
37class GUI_EXPORT QgsLayerTreeViewDefaultActions : public QObject
38{
39 Q_OBJECT
40 public:
42
43 QAction *actionAddGroup( QObject *parent = nullptr ) SIP_FACTORY;
44 QAction *actionRemoveGroupOrLayer( QObject *parent = nullptr ) SIP_FACTORY;
45 QAction *actionShowInOverview( QObject *parent = nullptr ) SIP_FACTORY;
46 QAction *actionRenameGroupOrLayer( QObject *parent = nullptr ) SIP_FACTORY;
47 QAction *actionShowFeatureCount( QObject *parent = nullptr ) SIP_FACTORY;
48
50 QAction *actionCheckAndAllChildren( QObject *parent = nullptr );
51
53 QAction *actionUncheckAndAllChildren( QObject *parent = nullptr );
54
56 QAction *actionCheckAndAllParents( QObject *parent = nullptr );
57
62 Q_DECL_DEPRECATED QAction *actionZoomToLayer( QgsMapCanvas *canvas, QObject *parent = nullptr ) SIP_FACTORY SIP_DEPRECATED;
63
68 QAction *actionZoomToLayers( QgsMapCanvas *canvas, QObject *parent = nullptr ) SIP_FACTORY;
69
74 QAction *actionZoomToSelection( QgsMapCanvas *canvas, QObject *parent = nullptr ) SIP_FACTORY;
75 QAction *actionZoomToGroup( QgsMapCanvas *canvas, QObject *parent = nullptr ) SIP_FACTORY;
76
80 Q_DECL_DEPRECATED QAction *actionMakeTopLevel( QObject *parent = nullptr ) SIP_FACTORY;
81
86 QAction *actionMoveOutOfGroup( QObject *parent = nullptr ) SIP_FACTORY;
87
92 QAction *actionMoveToTop( QObject *parent = nullptr ) SIP_FACTORY;
93
98 QAction *actionMoveToBottom( QObject *parent = nullptr ) SIP_FACTORY;
99 QAction *actionGroupSelected( QObject *parent = nullptr ) SIP_FACTORY;
100
104 QAction *actionMutuallyExclusiveGroup( QObject *parent = nullptr ) SIP_FACTORY;
105
110 Q_DECL_DEPRECATED void zoomToLayer( QgsMapCanvas *canvas ) SIP_DEPRECATED;
111
117 void zoomToLayers( QgsMapCanvas *canvas );
118
123 void zoomToSelection( QgsMapCanvas *canvas );
124 void zoomToGroup( QgsMapCanvas *canvas );
125
126 public slots:
127 void showInOverview();
128 void addGroup();
129
130 protected slots:
131 void removeGroupOrLayer();
132 void renameGroupOrLayer();
133 void showFeatureCount();
134
139 Q_DECL_DEPRECATED void zoomToLayer() SIP_DEPRECATED;
140
145 void zoomToLayers();
146
151 void zoomToSelection();
152 void zoomToGroup();
153
157 Q_DECL_DEPRECATED void makeTopLevel() SIP_DEPRECATED;
158
163 void moveOutOfGroup();
164
170 void moveToTop();
171
177 void moveToBottom();
178 void groupSelected();
179
183 void mutuallyExclusiveGroup();
184
185 private slots:
186 void checkAndAllChildren();
187 void uncheckAndAllChildren();
188 void checkAndAllParents();
189
190 protected:
191 void zoomToLayers( QgsMapCanvas *canvas, const QList<QgsMapLayer *> &layers );
192
193 QString uniqueGroupName( QgsLayerTreeGroup *parentGroup );
194
195 protected:
196 QgsLayerTreeView *mView = nullptr;
197};
198
199
200#endif // QGSLAYERTREEVIEWDEFAULTACTIONS_H
Layer tree group node serves as a container for layers and further groups.
Serves as a factory of actions that can be used together with a layer tree view.
Extends QTreeView and provides additional functionality when working with a layer tree.
Map canvas is a class for displaying all GIS data types on a canvas.
Base class for all map layer types.
Definition qgsmaplayer.h:77
#define SIP_DEPRECATED
Definition qgis_sip.h:106
#define SIP_FACTORY
Definition qgis_sip.h:76