QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
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 
29 class QDialogButtonBox;
31 
39 {
40  Q_OBJECT
41 
42  public:
43 
49  QgsLabelSettingsWidgetBase( QWidget *parent SIP_TRANSFERTHIS = nullptr, QgsVectorLayer *vl = nullptr );
50 
55  virtual void setContext( const QgsSymbolWidgetContext &context );
56 
61  QgsSymbolWidgetContext context() const;
62 
66  virtual void setGeometryType( QgsWkbTypes::GeometryType type );
67 
74  QgsPropertyCollection dataDefinedProperties() const;
75 
81  void setDataDefinedProperties( const QgsPropertyCollection &dataDefinedProperties );
82 
90  virtual void updateDataDefinedProperties( QgsPropertyCollection &properties );
91 
92  signals:
93 
97  void changed();
98 
103 
104  protected:
105 
107 
113  void registerDataDefinedButton( QgsPropertyOverrideButton *button, QgsPalLayerSettings::Property key );
114 
119 
120  private slots:
121 
122  void createAuxiliaryField();
123  void updateDataDefinedProperty();
124 
125  private:
126 
127  QgsVectorLayer *mVectorLayer = nullptr;
128 
129  bool mBlockSignals = false;
130 
131  QgsSymbolWidgetContext mContext;
132 
133 
134 };
135 
142 class GUI_EXPORT QgsLabelSettingsWidgetDialog : public QDialog
143 {
144  Q_OBJECT
145 
146  public:
147 
148 
154  QgsLabelSettingsWidgetDialog( QgsLabelSettingsWidgetBase *widget SIP_TRANSFER, QWidget *parent = nullptr );
155 
156 
162  QDialogButtonBox *buttonBox();
163 
164  private:
165 
166  QDialogButtonBox *mButtonBox = nullptr;
167 
168 };
169 
170 #endif // QGSLABELSETTINGSWIDGETBASE_H
QgsExpressionContext
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Definition: qgsexpressioncontext.h:370
qgspallabeling.h
QgsLabelSettingsWidgetBase::auxiliaryFieldCreated
void auxiliaryFieldCreated()
Emitted when an auxiliary field is created in the widget.
QgsSymbolWidgetContext
Contains settings which reflect the context in which a symbol (or renderer) widget is shown,...
Definition: qgssymbolwidgetcontext.h:36
qgssymbolwidgetcontext.h
QgsPropertyOverrideButton
A button for controlling property overrides which may apply to a widget.
Definition: qgspropertyoverridebutton.h:51
QgsPanelWidget
Base class for any widget that can be shown as a inline panel.
Definition: qgspanelwidget.h:30
QgsLabelSettingsWidgetDialog
A blocking dialog containing a QgsLabelSettingsWidgetBase.
Definition: qgslabelsettingswidgetbase.h:143
qgis_sip.h
SIP_TRANSFER
#define SIP_TRANSFER
Definition: qgis_sip.h:36
QgsExpressionContextGenerator::createExpressionContext
virtual QgsExpressionContext createExpressionContext() const =0
This method needs to be reimplemented in all classes which implement this interface and return an exp...
qgsexpressioncontextgenerator.h
QgsPropertyCollection
A grouped map of multiple QgsProperty objects, each referenced by a integer key value.
Definition: qgspropertycollection.h:319
QgsLabelSettingsWidgetBase
Base class for widgets which allow customization of label engine properties, such as label placement ...
Definition: qgslabelsettingswidgetbase.h:39
QgsWkbTypes::GeometryType
GeometryType
The geometry types are used to group QgsWkbTypes::Type in a coarse way.
Definition: qgswkbtypes.h:141
QgsVectorLayer
Represents a vector layer which manages a vector based data sets.
Definition: qgsvectorlayer.h:387
qgspropertycollection.h
QgsLabelSettingsWidgetBase::mDataDefinedProperties
QgsPropertyCollection mDataDefinedProperties
Contains the data defined properties defined by the widget.
Definition: qgslabelsettingswidgetbase.h:118
QgsPalLayerSettings::Property
Property
Data definable properties.
Definition: qgspallabeling.h:345
QgsLabelSettingsWidgetBase::changed
void changed()
Emitted when any of the settings described by the widget are changed.
qgspanelwidget.h
QgsExpressionContextGenerator
Abstract interface for generating an expression context.
Definition: qgsexpressioncontextgenerator.h:37
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53