QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
qgslayerpropertiesdialog.h
Go to the documentation of this file.
1/***************************************************************************
2 qgslayerpropertiesdialog.h
3 --------------------------------------
4 Date : June 2023
5 Copyright : (C) 2023 by Nyall Dawson
6 Email : nyall dot dawson 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 QGSLAYERPROPERTIESDIALOG_H
17#define QGSLAYERPROPERTIESDIALOG_H
18
19#include "qgsgui.h"
21#include "qgsmaplayerstyle.h"
22
23#include <QObject>
24#include <QPointer>
25
26class QgsMapLayer;
30class QgsMapCanvas;
31
40{
41 Q_OBJECT
42
43 public:
44
45#ifndef SIP_RUN
46
51 {
56 };
57 Q_ENUM( StyleType )
58#endif
59
70 QgsLayerPropertiesDialog( QgsMapLayer *layer, QgsMapCanvas *canvas, const QString &settingsKey, QWidget *parent SIP_TRANSFERTHIS = nullptr, Qt::WindowFlags fl = Qt::WindowFlags(), QgsSettings *settings = nullptr );
71
77 void setMetadataWidget( QgsMetadataWidget *widget, QWidget *page );
78
82 virtual void addPropertiesPageFactory( const QgsMapLayerConfigWidgetFactory *factory );
83
89 void saveDefaultStyle();
90
96 void loadStyle();
97
103 void saveStyleAs();
104
105 public slots:
106
112 void loadMetadataFromFile();
113
119 void saveMetadataToFile();
120
126 void saveMetadataAsDefault();
127
133 void loadDefaultMetadata();
134
140 void loadStyleFromFile();
141
147 void saveStyleToFile();
148
154 void saveStyleAsDefault();
155
159 void loadDefaultStyle();
160
161 protected:
162
167 void initialize();
168
172 void refocusDialog();
173
177 void storeCurrentStyleForUndo();
178
184
186 QPushButton *mBtnStyle = nullptr;
187
189 QPushButton *mBtnMetadata = nullptr;
190
192 QgsMapCanvas *mCanvas = nullptr;
193
195 QList<QgsMapLayerConfigWidget *> mConfigWidgets;
196
197 protected slots:
198
202 virtual void syncToLayer() SIP_SKIP = 0;
203
207 virtual void apply() SIP_SKIP = 0;
208
212 virtual void rollback();
213
214 void optionsStackedWidget_CurrentChanged( int index ) override;
215
222 void openUrl( const QUrl &url );
223
224 private:
225
229 QString generateDialogTitle() const;
230
231 QPointer< QgsMapLayer> mLayer;
232
233 QgsMetadataWidget *mMetadataWidget = nullptr;
234 QWidget *mMetadataPage = nullptr;
235
236};
237
238#endif // QGSLAYERPROPERTIESDIALOG_H
Base class for "layer properties" dialogs, containing common utilities for handling functionality in ...
QList< QgsMapLayerConfigWidget * > mConfigWidgets
Layer config widgets.
virtual void syncToLayer()=0
Resets the dialog to the current layer state.
QgsMapLayerStyle mOldStyle
Previous layer style.
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:93
Factory class for creating custom map layer property pages.
A panel widget that can be shown in the map style dock.
Stores style information (renderer, opacity, labeling, diagrams etc.) applicable to a map layer.
Base class for all map layer types.
Definition: qgsmaplayer.h:75
A wizard to edit metadata on a map layer.
A base dialog for options and properties dialogs that offers vertical tabs.
This class is a composition of two QSettings instances:
Definition: qgssettings.h:64
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53
#define SIP_SKIP
Definition: qgis_sip.h:126
#define SIP_ABSTRACT
Definition: qgis_sip.h:213