QGIS API Documentation 3.32.0-Lima (311a8cb8a6)
qgsvectorlayerproperties.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsdlgvectorlayerproperties.h
3 Unified property dialog for vector layers
4 -------------------
5 begin : 2004-01-28
6 copyright : (C) 2004 by Gary E.Sherman
7 email : sherman at mrcc.com
8***************************************************************************/
9
10/***************************************************************************
11 * *
12 * This program is free software; you can redistribute it and/or modify *
13 * it under the terms of the GNU General Public License as published by *
14 * the Free Software Foundation; either version 2 of the License, or *
15 * (at your option) any later version. *
16 * *
17 ***************************************************************************/
18
19#ifndef QGSVECTORLAYERPROPERTIES
20#define QGSVECTORLAYERPROPERTIES
21
22#include <QStandardItemModel>
23
25#include "ui_qgsvectorlayerpropertiesbase.h"
26#include "qgsguiutils.h"
30#include "qgsmaplayerstyle.h"
31
32class QgsMapLayer;
33
35class QgsVectorLayer;
43class QgsMessageBar;
45class QgsPanelWidget;
46class QgsVectorLayer3DRendererWidget;
49class QgsMaskingWidget;
52class QgsWebView;
53
58class GUI_EXPORT QgsVectorLayerProperties : public QgsOptionsDialogBase, private Ui::QgsVectorLayerPropertiesBase, private QgsExpressionContextGenerator
59{
60 Q_OBJECT
61
62 public:
63#ifndef SIP_RUN
65 {
70 };
71 Q_ENUM( StyleType )
72#endif
73
74 QgsVectorLayerProperties( QgsMapCanvas *canvas, QgsMessageBar *messageBar, QgsVectorLayer *lyr = nullptr, QWidget *parent = nullptr, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );
75
77 void addPropertiesPageFactory( const QgsMapLayerConfigWidgetFactory *factory );
78
79 bool eventFilter( QObject *obj, QEvent *ev ) override;
80
86 void loadDefaultStyle();
87
93 void saveDefaultStyle();
94
100 void loadStyle();
101
107 void saveStyleAs();
108
109 protected slots:
110 void optionsStackedWidget_CurrentChanged( int index ) final;
111
112 private slots:
113
114 void insertFieldOrExpression();
115
117 void syncToLayer();
118
120 QString htmlMetadata();
121
123 void apply();
124
126 void onCancel();
127
128 //
129 //methods reimplemented from qt designer base class
130 //
131
132 void pbnQueryBuilder_clicked();
133 void pbnIndex_clicked();
134 void mCrsSelector_crsChanged( const QgsCoordinateReferenceSystem &crs );
135 void loadMetadata();
136 void saveMetadataAs();
137 void saveDefaultMetadata();
138 void loadDefaultMetadata();
139 void pbnUpdateExtents_clicked();
140
141 void mButtonAddJoin_clicked();
142 void mButtonEditJoin_clicked();
143 void mJoinTreeWidget_itemDoubleClicked( QTreeWidgetItem *item, int column );
144 void mButtonRemoveJoin_clicked();
145
146 // Server properties
147 void addMetadataUrl();
148 void removeSelectedMetadataUrl();
149 void mButtonAddWmsDimension_clicked();
150 void mButtonEditWmsDimension_clicked();
151 void mWmsDimensionsTreeWidget_itemDoubleClicked( QTreeWidgetItem *item, int column );
152 void mButtonRemoveWmsDimension_clicked();
153
154 void mSimplifyDrawingGroupBox_toggled( bool checked );
155
156 signals:
157
159
161
162 private slots:
164 void toggleEditing();
165
167 void saveMultipleStylesAs();
168
169 void aboutToShowStyleMenu();
170
174 void updateVariableEditor();
175
176 void onAuxiliaryLayerNew();
177
178 void onAuxiliaryLayerClear();
179
180 void onAuxiliaryLayerDelete();
181
182 void onAuxiliaryLayerDeleteField();
183
184 void onAuxiliaryLayerAddField();
185
186 void urlClicked( const QUrl &url );
187
188 // Update the preview of the map tip
189 void updateMapTipPreview();
190 // Resize the map tip preview
191 void resizeMapTip();
192
193 private:
194
195 enum PropertyType
196 {
197 Style = 0,
198 Metadata,
199 };
200
201 void updateSymbologyPage();
202
203 void setPbnQueryBuilderEnabled();
204
205 QgsMapCanvas *mCanvas = nullptr;
206 QgsMessageBar *mMessageBar = nullptr;
207 QgsVectorLayer *mLayer = nullptr;
208
209 bool mMetadataFilled = false;
210
211 QString mOriginalSubsetSQL;
212
213 QPushButton *mBtnStyle = nullptr;
214 QPushButton *mBtnMetadata = nullptr;
215 QAction *mActionLoadMetadata = nullptr;
216 QAction *mActionSaveMetadataAs = nullptr;
217
218 QAction *mActionLoadStyle = nullptr;
219 QAction *mActionSaveStyle = nullptr;
220 QAction *mActionSaveMultipleStyles = nullptr;
221
223 QgsRendererPropertiesDialog *mRendererDialog = nullptr;
225 QgsLabelingWidget *labelingDialog = nullptr;
227 QgsMaskingWidget *mMaskingWidget = nullptr;
229 QgsAttributeActionDialog *mActionDialog = nullptr;
231 QgsDiagramProperties *diagramPropertiesDialog = nullptr;
233 QgsSourceFieldsProperties *mSourceFieldsPropertiesDialog = nullptr;
235 QgsAttributesFormProperties *mAttributesFormPropertiesDialog = nullptr;
236
238 QList< QgsVectorLayerJoinInfo > mOldJoins;
239
241 QList<QgsMapLayerConfigWidget *> mLayerPropertiesPages;
242
247 QgsMapLayerStyle mOldStyle;
248
249 void initDiagramTab();
250
252 void addJoinToTreeWidget( const QgsVectorLayerJoinInfo &join, int insertIndex = -1 );
253
255 void addWmsDimensionInfoToTreeWidget( const QgsMapLayerServerProperties::WmsDimensionInfo &wmsDim, int insertIndex = -1 );
256 QStandardItemModel *mMetadataUrlModel = nullptr;
257
258 void updateAuxiliaryStoragePage();
259 void deleteAuxiliaryField( int index );
260
261 QgsExpressionContext mContext;
262
264
265 QgsLayerTreeFilterProxyModel *mLayersDependenciesTreeModel;
266
267 void showHelp();
268
269 QgsMetadataWidget *mMetadataWidget = nullptr;
270
271 QAction *mAuxiliaryLayerActionNew = nullptr;
272 QAction *mAuxiliaryLayerActionClear = nullptr;
273 QAction *mAuxiliaryLayerActionDelete = nullptr;
274 QAction *mAuxiliaryLayerActionExport = nullptr;
275 QAction *mAuxiliaryLayerActionDeleteField = nullptr;
276 QAction *mAuxiliaryLayerActionAddField = nullptr;
277
278 QgsVectorLayer3DRendererWidget *mVector3DWidget = nullptr;
279
280 QgsVectorLayerTemporalPropertiesWidget *mTemporalWidget = nullptr;
281
282 QgsProviderSourceWidget *mSourceWidget = nullptr;
283
285
286 void initMapTipPreview();
287
288 QgsWebView *mMapTipPreview = nullptr;
289
290 private slots:
291 void openPanel( QgsPanelWidget *panel );
292
293 friend class QgsAppScreenShots;
294};
295
296#endif
Class allowing to manage the auxiliary storage for a vector layer.
This class represents a coordinate reference system (CRS).
The QgsSpinBox is a spin box with a clear button that will set the value to the defined clear value.
Abstract interface for generating an expression context.
virtual QgsExpressionContext createExpressionContext() const =0
This method needs to be reimplemented in all classes which implement this interface and return an exp...
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Master widget for configuration of labeling of a vector layer.
QgsLayerTreeFilterProxyModel is a sort filter proxy model to easily reproduce the legend/layer tree i...
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:90
The QgsMapLayerComboBox class is a combo box which displays the list of layers.
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:73
A bar for displaying non-blocking messages to the user.
Definition: qgsmessagebar.h:61
A wizard to edit metadata on a map layer.
A base dialog for options and properties dialogs that offers vertical tabs.
virtual void optionsStackedWidget_CurrentChanged(int index)
Select relevant tab on current page change.
Base class for any widget that can be shown as a inline panel.
Base class for widgets which allow customization of a provider's source URI.
Defines left outer join from our vector layer to some other vector layer.
void toggleEditing(QgsMapLayer *)
void exportAuxiliaryLayer(QgsAuxiliaryLayer *layer)
A widget for configuring the temporal properties for a vector layer.
Represents a vector layer which manages a vector based data sets.
The QgsWebView class is a collection of stubs to mimic the API of QWebView on systems where the real ...
Definition: qgswebview.h:66
#define SIP_SKIP
Definition: qgis_sip.h:126
const QgsCoordinateReferenceSystem & crs
Setting to define QGIS Server WMS Dimension.