QGIS API Documentation  3.24.2-Tisler (13c1a02865)
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 
24 #include "qgsoptionsdialogbase.h"
25 #include "ui_qgsvectorlayerpropertiesbase.h"
26 #include "qgsguiutils.h"
27 #include "qgshelp.h"
30 #include "qgsvectorlayerjoininfo.h"
31 #include "qgslayertree.h"
32 #include "qgslayertreemodel.h"
34 
35 class QgsMapLayer;
36 
38 class QgsVectorLayer;
39 class QgsLabelingWidget;
46 class QgsMessageBar;
47 class QgsMetadataWidget;
48 class QgsPanelWidget;
49 class QgsVectorLayer3DRendererWidget;
51 class QgsDoubleSpinBox;
52 class QgsMaskingWidget;
55 
60 class GUI_EXPORT QgsVectorLayerProperties : public QgsOptionsDialogBase, private Ui::QgsVectorLayerPropertiesBase, private QgsExpressionContextGenerator
61 {
62  Q_OBJECT
63 
64  public:
65 #ifndef SIP_RUN
66  enum StyleType
67  {
68  QML,
69  SLD,
70  DB,
71  };
72  Q_ENUM( StyleType )
73 #endif
74 
75  QgsVectorLayerProperties( QgsMapCanvas *canvas, QgsMessageBar *messageBar, QgsVectorLayer *lyr = nullptr, QWidget *parent = nullptr, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );
76 
78  void addPropertiesPageFactory( const QgsMapLayerConfigWidgetFactory *factory );
79 
80  protected slots:
81  void optionsStackedWidget_CurrentChanged( int index ) override SIP_SKIP;
82 
83  private slots:
84 
85  void insertFieldOrExpression();
86 
88  void syncToLayer();
89 
91  QString htmlMetadata();
92 
94  void apply();
95 
97  void onCancel();
98 
99  //
100  //methods reimplemented from qt designer base class
101  //
102 
103  void pbnQueryBuilder_clicked();
104  void pbnIndex_clicked();
105  void mCrsSelector_crsChanged( const QgsCoordinateReferenceSystem &crs );
106  void loadDefaultStyle_clicked();
107  void saveDefaultStyle_clicked();
108  void loadMetadata();
109  void saveMetadataAs();
110  void saveDefaultMetadata();
111  void loadDefaultMetadata();
112  void pbnUpdateExtents_clicked();
113 
114  void mButtonAddJoin_clicked();
115  void mButtonEditJoin_clicked();
116  void mJoinTreeWidget_itemDoubleClicked( QTreeWidgetItem *item, int column );
117  void mButtonRemoveJoin_clicked();
118 
119  // Server properties
120  void addMetadataUrl();
121  void removeSelectedMetadataUrl();
122  void mButtonAddWmsDimension_clicked();
123  void mButtonEditWmsDimension_clicked();
124  void mWmsDimensionsTreeWidget_itemDoubleClicked( QTreeWidgetItem *item, int column );
125  void mButtonRemoveWmsDimension_clicked();
126 
127  void mSimplifyDrawingGroupBox_toggled( bool checked );
128 
129  signals:
130 
132 
134 
135  private slots:
137  void toggleEditing();
138 
140  void saveStyleAs();
141 
143  void saveMultipleStylesAs();
144 
146  void loadStyle();
147 
148  void aboutToShowStyleMenu();
149 
153  void updateVariableEditor();
154 
155  void onAuxiliaryLayerNew();
156 
157  void onAuxiliaryLayerClear();
158 
159  void onAuxiliaryLayerDelete();
160 
161  void onAuxiliaryLayerDeleteField();
162 
163  void onAuxiliaryLayerAddField();
164 
165  void urlClicked( const QUrl &url );
166 
167  private:
168 
169  enum PropertyType
170  {
171  Style = 0,
172  Metadata,
173  };
174 
175  void updateSymbologyPage();
176 
177  void setPbnQueryBuilderEnabled();
178 
179  QgsMapCanvas *mCanvas = nullptr;
180  QgsMessageBar *mMessageBar = nullptr;
181  QgsVectorLayer *mLayer = nullptr;
182 
183  bool mMetadataFilled = false;
184 
185  QString mOriginalSubsetSQL;
186 
187  QPushButton *mBtnStyle = nullptr;
188  QPushButton *mBtnMetadata = nullptr;
189  QAction *mActionLoadMetadata = nullptr;
190  QAction *mActionSaveMetadataAs = nullptr;
191 
192  QAction *mActionLoadStyle = nullptr;
193  QAction *mActionSaveStyle = nullptr;
194  QAction *mActionSaveMultipleStyles = nullptr;
195 
197  QgsRendererPropertiesDialog *mRendererDialog = nullptr;
199  QgsLabelingWidget *labelingDialog = nullptr;
201  QgsMaskingWidget *mMaskingWidget = nullptr;
203  QgsAttributeActionDialog *mActionDialog = nullptr;
205  QgsDiagramProperties *diagramPropertiesDialog = nullptr;
207  QgsSourceFieldsProperties *mSourceFieldsPropertiesDialog = nullptr;
209  QgsAttributesFormProperties *mAttributesFormPropertiesDialog = nullptr;
210 
212  QList< QgsVectorLayerJoinInfo > mOldJoins;
213 
215  QList<QgsMapLayerConfigWidget *> mLayerPropertiesPages;
216 
221  QgsMapLayerStyle mOldStyle;
222 
223  void initDiagramTab();
224 
226  void addJoinToTreeWidget( const QgsVectorLayerJoinInfo &join, int insertIndex = -1 );
227 
229  void addWmsDimensionInfoToTreeWidget( const QgsMapLayerServerProperties::WmsDimensionInfo &wmsDim, int insertIndex = -1 );
230  QStandardItemModel *mMetadataUrlModel = nullptr;
231 
232  void updateAuxiliaryStoragePage();
233  void deleteAuxiliaryField( int index );
234 
235  QgsExpressionContext mContext;
236 
238 
239  QgsLayerTreeFilterProxyModel *mLayersDependenciesTreeModel;
240 
241  void showHelp();
242 
243  QgsMetadataWidget *mMetadataWidget = nullptr;
244 
245  QAction *mAuxiliaryLayerActionNew = nullptr;
246  QAction *mAuxiliaryLayerActionClear = nullptr;
247  QAction *mAuxiliaryLayerActionDelete = nullptr;
248  QAction *mAuxiliaryLayerActionExport = nullptr;
249  QAction *mAuxiliaryLayerActionDeleteField = nullptr;
250  QAction *mAuxiliaryLayerActionAddField = nullptr;
251 
252  QgsVectorLayer3DRendererWidget *mVector3DWidget = nullptr;
253 
254  QgsVectorLayerTemporalPropertiesWidget *mTemporalWidget = nullptr;
255 
256  QgsProviderSourceWidget *mSourceWidget = nullptr;
257 
258  QgsCoordinateReferenceSystem mBackupCrs;
259 
260  private slots:
261  void openPanel( QgsPanelWidget *panel );
262 
263  friend class QgsAppScreenShots;
264 };
265 
266 #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.
#define SIP_SKIP
Definition: qgis_sip.h:126
const QgsCoordinateReferenceSystem & crs
Setting to define QGIS Server WMS Dimension.