QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
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
"
20
#include "
qgsmaplayerstyle.h
"
21
#include "
qgsoptionsdialogbase.h
"
22
23
#include <QObject>
24
#include <QPointer>
25
26
class
QgsMapLayer
;
27
class
QgsMetadataWidget
;
28
class
QgsMapLayerConfigWidget
;
29
class
QgsMapLayerConfigWidgetFactory
;
30
class
QgsMapCanvas
;
31
39
class
GUI_EXPORT
QgsLayerPropertiesDialog
:
public
QgsOptionsDialogBase
SIP_ABSTRACT
40
{
41
Q_OBJECT
42
43
public
:
44
#ifndef SIP_RUN
45
49
enum
StyleType
50
{
51
QML
,
52
SLD
,
53
DatasourceDatabase
,
54
UserDatabase
,
55
};
56
Q_ENUM( StyleType )
57
#endif
58
69
QgsLayerPropertiesDialog
(
70
QgsMapLayer
*layer,
QgsMapCanvas
*canvas,
const
QString &settingsKey, QWidget *parent
SIP_TRANSFERTHIS
=
nullptr
, Qt::WindowFlags fl = Qt::WindowFlags(),
QgsSettings
*settings =
nullptr
71
);
72
78
void
setMetadataWidget(
QgsMetadataWidget
*widget, QWidget *page );
79
83
virtual
void
addPropertiesPageFactory(
const
QgsMapLayerConfigWidgetFactory
*factory );
84
90
void
saveDefaultStyle();
91
97
void
loadStyle();
98
104
void
saveStyleAs();
105
106
public
slots:
107
113
void
loadMetadataFromFile();
114
120
void
saveMetadataToFile();
121
127
void
saveMetadataAsDefault();
128
134
void
loadDefaultMetadata();
135
141
void
loadStyleFromFile();
142
148
void
saveStyleToFile();
149
155
void
saveStyleAsDefault();
156
160
void
loadDefaultStyle();
161
162
protected
:
167
void
initialize();
168
172
void
refocusDialog();
173
177
void
storeCurrentStyleForUndo();
178
183
QgsMapLayerStyle
mOldStyle
;
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:
228
QString generateDialogTitle() const;
229
230
QPointer<
QgsMapLayer
> mLayer;
231
232
QgsMetadataWidget
*mMetadataWidget =
nullptr
;
233
QWidget *mMetadataPage =
nullptr
;
234
};
235
236
#endif
// QGSLAYERPROPERTIESDIALOG_H
QgsLayerPropertiesDialog
Base class for "layer properties" dialogs, containing common utilities for handling functionality in ...
Definition
qgslayerpropertiesdialog.h:40
QgsLayerPropertiesDialog::mBtnStyle
QPushButton * mBtnStyle
Style button.
Definition
qgslayerpropertiesdialog.h:186
QgsLayerPropertiesDialog::rollback
virtual void rollback()
Rolls back changes made to the layer.
Definition
qgslayerpropertiesdialog.cpp:593
QgsLayerPropertiesDialog::optionsStackedWidget_CurrentChanged
void optionsStackedWidget_CurrentChanged(int index) override
Definition
qgslayerpropertiesdialog.cpp:607
QgsLayerPropertiesDialog::StyleType
StyleType
Style storage type.
Definition
qgslayerpropertiesdialog.h:50
QgsLayerPropertiesDialog::QML
@ QML
Definition
qgslayerpropertiesdialog.h:51
QgsLayerPropertiesDialog::UserDatabase
@ UserDatabase
Definition
qgslayerpropertiesdialog.h:54
QgsLayerPropertiesDialog::SLD
@ SLD
Definition
qgslayerpropertiesdialog.h:52
QgsLayerPropertiesDialog::DatasourceDatabase
@ DatasourceDatabase
Definition
qgslayerpropertiesdialog.h:53
QgsLayerPropertiesDialog::mConfigWidgets
QList< QgsMapLayerConfigWidget * > mConfigWidgets
Layer config widgets.
Definition
qgslayerpropertiesdialog.h:195
QgsLayerPropertiesDialog::apply
virtual void apply()=0
Applies the dialog settings to the layer.
QgsLayerPropertiesDialog::syncToLayer
virtual void syncToLayer()=0
Resets the dialog to the current layer state.
QgsLayerPropertiesDialog::mCanvas
QgsMapCanvas * mCanvas
Associated map canvas.
Definition
qgslayerpropertiesdialog.h:192
QgsLayerPropertiesDialog::QgsLayerPropertiesDialog
QgsLayerPropertiesDialog(QgsMapLayer *layer, QgsMapCanvas *canvas, const QString &settingsKey, QWidget *parent=nullptr, Qt::WindowFlags fl=Qt::WindowFlags(), QgsSettings *settings=nullptr)
Constructor for QgsLayerPropertiesDialog.
Definition
qgslayerpropertiesdialog.cpp:44
QgsLayerPropertiesDialog::mOldStyle
QgsMapLayerStyle mOldStyle
Previous layer style.
Definition
qgslayerpropertiesdialog.h:183
QgsLayerPropertiesDialog::mBtnMetadata
QPushButton * mBtnMetadata
Metadata button.
Definition
qgslayerpropertiesdialog.h:189
QgsLayerPropertiesDialog::openUrl
void openUrl(const QUrl &url)
Handles opening a url from the dialog.
Definition
qgslayerpropertiesdialog.cpp:619
QgsMapCanvas
Map canvas is a class for displaying all GIS data types on a canvas.
Definition
qgsmapcanvas.h:96
QgsMapLayerConfigWidgetFactory
Factory class for creating custom map layer property pages.
Definition
qgsmaplayerconfigwidgetfactory.h:35
QgsMapLayerConfigWidget
A panel widget that can be shown in the map style dock.
Definition
qgsmaplayerconfigwidget.h:112
QgsMapLayerStyle
Stores style information (renderer, opacity, labeling, diagrams etc.) applicable to a map layer.
Definition
qgsmaplayerstyle.h:41
QgsMapLayer
Base class for all map layer types.
Definition
qgsmaplayer.h:83
QgsMetadataWidget
A wizard to edit metadata on a map layer.
Definition
qgsmetadatawidget.h:42
QgsOptionsDialogBase::QgsOptionsDialogBase
QgsOptionsDialogBase(const QString &settingsKey, QWidget *parent=nullptr, Qt::WindowFlags fl=Qt::WindowFlags(), QgsSettings *settings=nullptr)
Constructor.
Definition
qgsoptionsdialogbase.cpp:50
QgsSettings
Stores settings for use within QGIS.
Definition
qgssettings.h:68
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:52
SIP_SKIP
#define SIP_SKIP
Definition
qgis_sip.h:138
SIP_ABSTRACT
#define SIP_ABSTRACT
Definition
qgis_sip.h:225
qgsgui.h
qgsmaplayerstyle.h
qgsoptionsdialogbase.h
Generated on
for QGIS API Documentation by
1.17.0