QGIS API Documentation 3.41.0-Master (fda2aa46e9a)
Loading...
Searching...
No Matches
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
38class GUI_EXPORT QgsLayerTreeViewDefaultActions : public QObject
39{
40 Q_OBJECT
41 public:
43
44 QAction *actionAddGroup( QObject *parent = nullptr ) SIP_FACTORY;
45 QAction *actionRemoveGroupOrLayer( QObject *parent = nullptr ) SIP_FACTORY;
46 QAction *actionShowInOverview( QObject *parent = nullptr ) SIP_FACTORY;
47 QAction *actionRenameGroupOrLayer( QObject *parent = nullptr ) SIP_FACTORY;
48 QAction *actionShowFeatureCount( QObject *parent = nullptr ) SIP_FACTORY;
49
51 QAction *actionCheckAndAllChildren( QObject *parent = nullptr );
52
54 QAction *actionUncheckAndAllChildren( QObject *parent = nullptr );
55
57 QAction *actionCheckAndAllParents( QObject *parent = nullptr );
58
63 Q_DECL_DEPRECATED QAction *actionZoomToLayer( QgsMapCanvas *canvas, QObject *parent = nullptr ) SIP_FACTORY SIP_DEPRECATED;
64
69 QAction *actionZoomToLayers( QgsMapCanvas *canvas, QObject *parent = nullptr ) SIP_FACTORY;
70
75 QAction *actionZoomToSelection( QgsMapCanvas *canvas, QObject *parent = nullptr ) SIP_FACTORY;
76 QAction *actionZoomToGroup( QgsMapCanvas *canvas, QObject *parent = nullptr ) SIP_FACTORY;
77
81 Q_DECL_DEPRECATED QAction *actionMakeTopLevel( QObject *parent = nullptr ) SIP_FACTORY;
82
87 QAction *actionMoveOutOfGroup( QObject *parent = nullptr ) SIP_FACTORY;
88
93 QAction *actionMoveToTop( QObject *parent = nullptr ) SIP_FACTORY;
94
99 QAction *actionMoveToBottom( QObject *parent = nullptr ) SIP_FACTORY;
100 QAction *actionGroupSelected( QObject *parent = nullptr ) SIP_FACTORY;
101
105 QAction *actionMutuallyExclusiveGroup( QObject *parent = nullptr ) SIP_FACTORY;
106
111 Q_DECL_DEPRECATED void zoomToLayer( QgsMapCanvas *canvas ) SIP_DEPRECATED;
112
118 void zoomToLayers( QgsMapCanvas *canvas );
119
124 void zoomToSelection( QgsMapCanvas *canvas );
125 void zoomToGroup( QgsMapCanvas *canvas );
126
127 public slots:
128 void showInOverview();
129 void addGroup();
130
131 protected slots:
132 void removeGroupOrLayer();
133 void renameGroupOrLayer();
134 void showFeatureCount();
135
140 Q_DECL_DEPRECATED void zoomToLayer() SIP_DEPRECATED;
141
146 void zoomToLayers();
147
152 void zoomToSelection();
153 void zoomToGroup();
154
158 Q_DECL_DEPRECATED void makeTopLevel() SIP_DEPRECATED;
159
164 void moveOutOfGroup();
165
171 void moveToTop();
172
178 void moveToBottom();
179 void groupSelected();
180
184 void mutuallyExclusiveGroup();
185
186 private slots:
187 void checkAndAllChildren();
188 void uncheckAndAllChildren();
189 void checkAndAllParents();
190
191 protected:
192 void zoomToLayers( QgsMapCanvas *canvas, const QList<QgsMapLayer *> &layers );
193
194 QString uniqueGroupName( QgsLayerTreeGroup *parentGroup );
195
196 protected:
197 QgsLayerTreeView *mView = nullptr;
198};
199
200
201#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.
Base class for all map layer types.
Definition qgsmaplayer.h:76
#define SIP_DEPRECATED
Definition qgis_sip.h:106
#define SIP_FACTORY
Definition qgis_sip.h:76