QGIS API Documentation 3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
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#ifndef SIP_RUN
45
56 Q_ENUM( StyleType )
57#endif
58
69 QgsLayerPropertiesDialog( QgsMapLayer *layer, QgsMapCanvas *canvas, const QString &settingsKey, QWidget *parent SIP_TRANSFERTHIS = nullptr, Qt::WindowFlags fl = Qt::WindowFlags(), QgsSettings *settings = nullptr );
70
76 void setMetadataWidget( QgsMetadataWidget *widget, QWidget *page );
77
81 virtual void addPropertiesPageFactory( const QgsMapLayerConfigWidgetFactory *factory );
82
88 void saveDefaultStyle();
89
95 void loadStyle();
96
102 void saveStyleAs();
103
104 public slots:
105
111 void loadMetadataFromFile();
112
118 void saveMetadataToFile();
119
125 void saveMetadataAsDefault();
126
132 void loadDefaultMetadata();
133
139 void loadStyleFromFile();
140
146 void saveStyleToFile();
147
153 void saveStyleAsDefault();
154
158 void loadDefaultStyle();
159
160 protected:
165 void initialize();
166
170 void refocusDialog();
171
175 void storeCurrentStyleForUndo();
176
182
184 QPushButton *mBtnStyle = nullptr;
185
187 QPushButton *mBtnMetadata = nullptr;
188
190 QgsMapCanvas *mCanvas = nullptr;
191
193 QList<QgsMapLayerConfigWidget *> mConfigWidgets;
194
195 protected slots:
196
200 virtual void syncToLayer() SIP_SKIP
201 = 0;
202
206 virtual void apply() SIP_SKIP
207 = 0;
208
212 virtual void rollback();
213
214 void optionsStackedWidget_CurrentChanged( int index ) override;
215
222 void openUrl( const QUrl &url );
223
224 private:
228 QString generateDialogTitle() const;
229
230 QPointer<QgsMapLayer> mLayer;
231
232 QgsMetadataWidget *mMetadataWidget = nullptr;
233 QWidget *mMetadataPage = nullptr;
234};
235
236#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.
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:76
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