QGIS API Documentation  3.12.1-BucureČ™ti (121cc00ff0)
qgslabelsettingswidgetbase.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgslabelsettingswidgetbase.h
3  ----------------------
4  begin : December 2019
5  copyright : (C) 2019 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 QGSLABELSETTINGSWIDGETBASE_H
17 #define QGSLABELSETTINGSWIDGETBASE_H
18 
19 #include "qgssymbolwidgetcontext.h"
20 #include "qgspallabeling.h"
21 #include "qgspropertycollection.h"
22 #include "qgspanelwidget.h"
24 #include "qgis_gui.h"
25 #include "qgis_sip.h"
26 
27 #include <QDialog>
28 
30 
38 {
39  Q_OBJECT
40 
41  public:
42 
48  QgsLabelSettingsWidgetBase( QWidget *parent SIP_TRANSFERTHIS = nullptr, QgsVectorLayer *vl = nullptr );
49 
54  virtual void setContext( const QgsSymbolWidgetContext &context );
55 
60  QgsSymbolWidgetContext context() const;
61 
65  virtual void setGeometryType( QgsWkbTypes::GeometryType type );
66 
73  QgsPropertyCollection dataDefinedProperties() const;
74 
80  void setDataDefinedProperties( const QgsPropertyCollection &dataDefinedProperties );
81 
89  virtual void updateDataDefinedProperties( QgsPropertyCollection &properties );
90 
91  signals:
92 
96  void changed();
97 
101  void auxiliaryFieldCreated();
102 
103  protected:
104 
106 
112  void registerDataDefinedButton( QgsPropertyOverrideButton *button, QgsPalLayerSettings::Property key );
113 
118 
119  private slots:
120 
121  void createAuxiliaryField();
122  void updateDataDefinedProperty();
123 
124  private:
125 
126  QgsVectorLayer *mVectorLayer = nullptr;
127 
128  bool mBlockSignals = false;
129 
130  QgsSymbolWidgetContext mContext;
131 
132 
133 };
134 
141 class GUI_EXPORT QgsLabelSettingsWidgetDialog : public QDialog
142 {
143  Q_OBJECT
144 
145  public:
146 
147 
153  QgsLabelSettingsWidgetDialog( QgsLabelSettingsWidgetBase *widget SIP_TRANSFER, QWidget *parent = nullptr );
154 
155 };
156 
157 #endif // QGSLABELSETTINGSWIDGETBASE_H
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53
Base class for widgets which allow customization of label engine properties, such as label placement ...
Base class for any widget that can be shown as a inline panel.
A blocking dialog containing a QgsLabelSettingsWidgetBase.
Property
Data definable properties.
virtual QgsExpressionContext createExpressionContext() const =0
This method needs to be reimplemented in all classes which implement this interface and return an exp...
A button for controlling property overrides which may apply to a widget.
Contains settings which reflect the context in which a symbol (or renderer) widget is shown...
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
#define SIP_TRANSFER
Definition: qgis_sip.h:36
QgsPropertyCollection mDataDefinedProperties
Contains the data defined properties defined by the widget.
Abstract interface for generating an expression context.
GeometryType
The geometry types are used to group QgsWkbTypes::Type in a coarse way.
Definition: qgswkbtypes.h:139
A grouped map of multiple QgsProperty objects, each referenced by a integer key value.
Represents a vector layer which manages a vector based data sets.