QGIS API Documentation 4.3.0-Master (96c7fa699b4)
Loading...
Searching...
No Matches
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 "qgis_gui.h"
20#include "qgis_sip.h"
22#include "qgspallabeling.h"
23#include "qgspanelwidget.h"
26
27#include <QDialog>
28
29class QDialogButtonBox;
31
39{
40 Q_OBJECT
41
42 public:
48 QgsLabelSettingsWidgetBase( QWidget *parent SIP_TRANSFERTHIS = nullptr, QgsMapLayer *vl = nullptr );
49
54 virtual void setContext( const QgsSymbolWidgetContext &context );
55
61
65 virtual void setGeometryType( Qgis::GeometryType type );
66
74
81
89 virtual void updateDataDefinedProperties( QgsPropertyCollection &properties );
90
91 signals:
92
97
98 protected:
100
107
112
113 private slots:
114
115 void createAuxiliaryField();
116 void updateDataDefinedProperty();
117
118 private:
119 QPointer< QgsMapLayer > mLayer = nullptr;
120
121 QgsSymbolWidgetContext mContext;
122};
123
130class GUI_EXPORT QgsLabelSettingsWidgetDialog : public QDialog
131{
132 Q_OBJECT
133
134 public:
140 QgsLabelSettingsWidgetDialog( QgsLabelSettingsWidgetBase *widget SIP_TRANSFER, QWidget *parent = nullptr );
141
142
148 QDialogButtonBox *buttonBox();
149
150 private:
151 QDialogButtonBox *mButtonBox = nullptr;
152};
153
154#endif // QGSLABELSETTINGSWIDGETBASE_H
GeometryType
The geometry types are used to group Qgis::WkbType in a coarse way.
Definition qgis.h:399
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...
Base class for widgets which allow customization of label engine properties, such as label placement ...
QgsLabelSettingsWidgetBase(QWidget *parent=nullptr, QgsMapLayer *vl=nullptr)
Constructor for QgsLabelSettingsWidgetBase.
virtual void updateDataDefinedProperties(QgsPropertyCollection &properties)
Updates a data defined properties collection, correctly setting the values for any properties related...
QgsSymbolWidgetContext context() const
Returns the context in which the symbol widget is shown, e.g., the associated map canvas and expressi...
void registerDataDefinedButton(QgsPropertyOverrideButton *button, QgsPalLayerSettings::Property key)
Registers a data defined override button.
virtual void setContext(const QgsSymbolWidgetContext &context)
Sets the context in which the symbol widget is shown, e.g., the associated map canvas and expression ...
QgsPropertyCollection mDataDefinedProperties
Contains the data defined properties defined by the widget.
virtual void setGeometryType(Qgis::GeometryType type)
Sets the geometry type of the features to customize the widget accordingly.
void auxiliaryFieldCreated()
Emitted when an auxiliary field is created in the widget.
void setDataDefinedProperties(const QgsPropertyCollection &dataDefinedProperties)
Sets the current data defined properties to show in the widget.
QgsPropertyCollection dataDefinedProperties() const
Returns the current data defined properties state as specified in the widget.
QgsLabelSettingsWidgetDialog(QgsLabelSettingsWidgetBase *widget, QWidget *parent=nullptr)
Constructor for QgsLabelSettingsWidgetDialog.
QDialogButtonBox * buttonBox()
Returns the dialog's button box.
Base class for all map layer types.
Definition qgsmaplayer.h:83
Property
Data definable properties.
QgsPanelWidget(QWidget *parent=nullptr)
Base class for any widget that can be shown as an inline panel.
A grouped map of multiple QgsProperty objects, each referenced by an integer key value.
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,...
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:52
#define SIP_TRANSFER
Definition qgis_sip.h:35