QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
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,
72  };
73  Q_ENUM( StyleType )
74 #endif
75 
76  QgsVectorLayerProperties( QgsMapCanvas *canvas, QgsMessageBar *messageBar, QgsVectorLayer *lyr = nullptr, QWidget *parent = nullptr, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );
77 
79  void addPropertiesPageFactory( const QgsMapLayerConfigWidgetFactory *factory );
80 
81  protected slots:
82  void optionsStackedWidget_CurrentChanged( int index ) override SIP_SKIP;
83 
84  private slots:
85 
86  void insertFieldOrExpression();
87 
89  void syncToLayer();
90 
92  QString htmlMetadata();
93 
95  void apply();
96 
98  void onCancel();
99 
100  //
101  //methods reimplemented from qt designer base class
102  //
103 
104  void pbnQueryBuilder_clicked();
105  void pbnIndex_clicked();
106  void mCrsSelector_crsChanged( const QgsCoordinateReferenceSystem &crs );
107  void loadDefaultStyle_clicked();
108  void saveDefaultStyle_clicked();
109  void loadMetadata();
110  void saveMetadataAs();
111  void saveDefaultMetadata();
112  void loadDefaultMetadata();
113  void pbnUpdateExtents_clicked();
114 
115  void mButtonAddJoin_clicked();
116  void mButtonEditJoin_clicked();
117  void mJoinTreeWidget_itemDoubleClicked( QTreeWidgetItem *item, int column );
118  void mButtonRemoveJoin_clicked();
119 
120  // Server properties
121  void addMetadataUrl();
122  void removeSelectedMetadataUrl();
123  void mButtonAddWmsDimension_clicked();
124  void mButtonEditWmsDimension_clicked();
125  void mWmsDimensionsTreeWidget_itemDoubleClicked( QTreeWidgetItem *item, int column );
126  void mButtonRemoveWmsDimension_clicked();
127 
128  void mSimplifyDrawingGroupBox_toggled( bool checked );
129 
130  signals:
131 
132  void toggleEditing( QgsMapLayer * ) SIP_SKIP;
133 
134  void exportAuxiliaryLayer( QgsAuxiliaryLayer *layer ) SIP_SKIP;
135 
136  private slots:
138  void toggleEditing();
139 
141  void saveStyleAs();
142 
144  void saveMultipleStylesAs();
145 
147  void loadStyle();
148 
149  void aboutToShowStyleMenu();
150 
154  void updateVariableEditor();
155 
156  void onAuxiliaryLayerNew();
157 
158  void onAuxiliaryLayerClear();
159 
160  void onAuxiliaryLayerDelete();
161 
162  void onAuxiliaryLayerDeleteField();
163 
164  void onAuxiliaryLayerAddField();
165 
166  void urlClicked( const QUrl &url );
167 
168  private:
169 
170  enum PropertyType
171  {
172  Style = 0,
173  Metadata,
174  };
175 
176  void updateSymbologyPage();
177 
178  void setPbnQueryBuilderEnabled();
179 
180  QgsMapCanvas *mCanvas = nullptr;
181  QgsMessageBar *mMessageBar = nullptr;
182  QgsVectorLayer *mLayer = nullptr;
183 
184  bool mMetadataFilled = false;
185 
186  QString mOriginalSubsetSQL;
187 
188  QPushButton *mBtnStyle = nullptr;
189  QPushButton *mBtnMetadata = nullptr;
190  QAction *mActionLoadMetadata = nullptr;
191  QAction *mActionSaveMetadataAs = nullptr;
192 
193  QAction *mActionLoadStyle = nullptr;
194  QAction *mActionSaveStyle = nullptr;
195  QAction *mActionSaveMultipleStyles = nullptr;
196 
198  QgsRendererPropertiesDialog *mRendererDialog = nullptr;
200  QgsLabelingWidget *labelingDialog = nullptr;
202  QgsMaskingWidget *mMaskingWidget = nullptr;
204  QgsAttributeActionDialog *mActionDialog = nullptr;
206  QgsDiagramProperties *diagramPropertiesDialog = nullptr;
208  QgsSourceFieldsProperties *mSourceFieldsPropertiesDialog = nullptr;
210  QgsAttributesFormProperties *mAttributesFormPropertiesDialog = nullptr;
211 
213  QList< QgsVectorLayerJoinInfo > mOldJoins;
214 
216  QList<QgsMapLayerConfigWidget *> mLayerPropertiesPages;
217 
222  QgsMapLayerStyle mOldStyle;
223 
224  void initDiagramTab();
225 
227  void addJoinToTreeWidget( const QgsVectorLayerJoinInfo &join, int insertIndex = -1 );
228 
230  void addWmsDimensionInfoToTreeWidget( const QgsMapLayerServerProperties::WmsDimensionInfo &wmsDim, int insertIndex = -1 );
231  QStandardItemModel *mMetadataUrlModel = nullptr;
232 
233  void updateAuxiliaryStoragePage();
234  void deleteAuxiliaryField( int index );
235 
236  QgsExpressionContext mContext;
237 
239 
240  QgsLayerTreeFilterProxyModel *mLayersDependenciesTreeModel;
241 
242  void showHelp();
243 
244  QgsMetadataWidget *mMetadataWidget = nullptr;
245 
246  QAction *mAuxiliaryLayerActionNew = nullptr;
247  QAction *mAuxiliaryLayerActionClear = nullptr;
248  QAction *mAuxiliaryLayerActionDelete = nullptr;
249  QAction *mAuxiliaryLayerActionExport = nullptr;
250  QAction *mAuxiliaryLayerActionDeleteField = nullptr;
251  QAction *mAuxiliaryLayerActionAddField = nullptr;
252 
253  QgsVectorLayer3DRendererWidget *mVector3DWidget = nullptr;
254 
255  QgsVectorLayerTemporalPropertiesWidget *mTemporalWidget = nullptr;
256 
257  QgsProviderSourceWidget *mSourceWidget = nullptr;
258 
259  QgsCoordinateReferenceSystem mBackupCrs;
260 
261  private slots:
262  void openPanel( QgsPanelWidget *panel );
263 
264  friend class QgsAppScreenShots;
265 };
266 
267 #endif
qgsmaplayerserverproperties.h
QgsExpressionContext
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Definition: qgsexpressioncontext.h:406
qgsmaplayerstylemanager.h
QgsOptionsDialogBase
A base dialog for options and properties dialogs that offers vertical tabs. It handles saving/restori...
Definition: qgsoptionsdialogbase.h:86
QgsServerWmsDimensionProperties::WmsDimensionInfo
Setting to define QGIS Server WMS Dimension.
Definition: qgsmaplayerserverproperties.h:156
QgsAuxiliaryLayer
Class allowing to manage the auxiliary storage for a vector layer.
Definition: qgsauxiliarystorage.h:61
QgsAttributesFormProperties
Definition: qgsattributesformproperties.h:61
crs
const QgsCoordinateReferenceSystem & crs
Definition: qgswfsgetfeature.cpp:105
QgsMapCanvas
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:89
QgsLabelingWidget::QgsLabelingWidget
QgsLabelingWidget(QgsVectorLayer *layer, QgsMapCanvas *canvas, QWidget *parent=nullptr, QgsMessageBar *messageBar=nullptr)
constructor
Definition: qgslabelingwidget.cpp:31
QgsVectorLayerProperties::StyleType
StyleType
Definition: qgsvectorlayerproperties.h:66
qgsvectorlayerjoininfo.h
QgsMapLayerConfigWidget
A panel widget that can be shown in the map style dock.
Definition: qgsmaplayerconfigwidget.h:115
QgsLayerTreeFilterProxyModel
QgsLayerTreeFilterProxyModel is a sort filter proxy model to easily reproduce the legend/layer tree i...
Definition: qgslayertreefilterproxymodel.h:41
QgsProviderSourceWidget
Base class for widgets which allow customization of a provider's source URI.
Definition: qgsprovidersourcewidget.h:32
qgsoptionsdialogbase.h
QgsVectorLayerProperties::DB
@ DB
Definition: qgsvectorlayerproperties.h:70
SIP_SKIP
#define SIP_SKIP
Definition: qgis_sip.h:126
QgsVectorLayerProperties::Local
@ Local
Definition: qgsvectorlayerproperties.h:71
QgsPanelWidget
Base class for any widget that can be shown as a inline panel.
Definition: qgspanelwidget.h:29
QgsAttributeActionDialog
Definition: qgsattributeactiondialog.h:42
QgsMessageBar
A bar for displaying non-blocking messages to the user.
Definition: qgsmessagebar.h:60
QgsVectorLayerProperties::QML
@ QML
Definition: qgsvectorlayerproperties.h:68
QgsExpressionContextGenerator::createExpressionContext
virtual QgsExpressionContext createExpressionContext() const =0
This method needs to be reimplemented in all classes which implement this interface and return an exp...
QgsVectorLayerProperties
Definition: qgsvectorlayerproperties.h:60
QgsVectorLayerProperties::SLD
@ SLD
Definition: qgsvectorlayerproperties.h:69
QgsVectorLayerJoinInfo
Defines left outer join from our vector layer to some other vector layer. The join is done based on [...
Definition: qgsvectorlayerjoininfo.h:33
QgsDiagramProperties
Definition: qgsdiagramproperties.h:40
qgslayertree.h
QgsCoordinateReferenceSystem
This class represents a coordinate reference system (CRS).
Definition: qgscoordinatereferencesystem.h:211
QgsMapLayerComboBox
The QgsMapLayerComboBox class is a combo box which displays the list of layers.
Definition: qgsmaplayercombobox.h:34
QgsVectorLayerTemporalPropertiesWidget
A widget for configuring the temporal properties for a vector layer.
Definition: qgsvectorlayertemporalpropertieswidget.h:34
QgsOptionsDialogBase::optionsStackedWidget_CurrentChanged
virtual void optionsStackedWidget_CurrentChanged(int index)
Select relevant tab on current page change.
Definition: qgsoptionsdialogbase.cpp:783
QgsVectorLayer
Represents a vector layer which manages a vector based data sets.
Definition: qgsvectorlayer.h:391
QgsSourceFieldsProperties
Definition: qgssourcefieldsproperties.h:47
QgsMapLayer
Base class for all map layer types. This is the base class for all map layer types (vector,...
Definition: qgsmaplayer.h:72
QgsDoubleSpinBox
The QgsSpinBox is a spin box with a clear button that will set the value to the defined clear value....
Definition: qgsdoublespinbox.h:42
QgsMetadataWidget
A wizard to edit metadata on a map layer.
Definition: qgsmetadatawidget.h:41
qgslayertreemodel.h
QgsMapLayerStyle
Stores style information (renderer, opacity, labeling, diagrams etc.) applicable to a map layer.
Definition: qgsmaplayerstyle.h:42
QgsRendererPropertiesDialog
Definition: qgsrendererpropertiesdialog.h:43
qgsguiutils.h
qgslayertreefilterproxymodel.h
QgsExpressionContextGenerator
Abstract interface for generating an expression context.
Definition: qgsexpressioncontextgenerator.h:36
qgshelp.h
QgsMapLayerConfigWidgetFactory
Factory class for creating custom map layer property pages.
Definition: qgsmaplayerconfigwidgetfactory.h:34