QGIS API Documentation  3.22.4-Białowieża (ce8e65e95e)
qgslayerpropertieswidget.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgslayerpropertieswidget.cpp
3  ----------------------------
4  begin : June 2012
5  copyright : (C) 2012 by Arunmozhi
6  email : aruntheguy at gmail.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 
17 
18 #include <QFile>
19 #include <QStandardItem>
20 #include <QKeyEvent>
21 #include <QMessageBox>
22 #include <QPicture>
23 
24 #include "qgssymbollayer.h"
25 #include "qgssymbollayerregistry.h"
26 #include "qgspainteffectregistry.h"
27 
28 #include "qgsapplication.h"
29 #include "qgslogger.h"
30 
31 #include "qgssymbollayerwidget.h"
36 #include "qgssymbol.h" //for the unit
37 #include "qgspanelwidget.h"
38 #include "qgsmapcanvas.h"
39 #include "qgspainteffect.h"
40 #include "qgsproject.h"
41 #include "qgsvectorlayer.h"
44 #include "qgstemporalcontroller.h"
45 #include "qgssymbollayerutils.h"
46 
47 static bool _initWidgetFunction( const QString &name, QgsSymbolLayerWidgetFunc f )
48 {
50 
51  QgsSymbolLayerAbstractMetadata *abstractMetadata = reg->symbolLayerMetadata( name );
52  if ( !abstractMetadata )
53  {
54  QgsDebugMsg( "Failed to find symbol layer's entry in registry: " + name );
55  return false;
56  }
57  QgsSymbolLayerMetadata *metadata = dynamic_cast<QgsSymbolLayerMetadata *>( abstractMetadata );
58  if ( !metadata )
59  {
60  QgsDebugMsg( "Failed to cast symbol layer's metadata: " + name );
61  return false;
62  }
63  metadata->setWidgetFunction( f );
64  return true;
65 }
66 
67 static void _initWidgetFunctions()
68 {
69  static bool sInitialized = false;
70  if ( sInitialized )
71  return;
72 
73  _initWidgetFunction( QStringLiteral( "SimpleLine" ), QgsSimpleLineSymbolLayerWidget::create );
74  _initWidgetFunction( QStringLiteral( "MarkerLine" ), QgsMarkerLineSymbolLayerWidget::create );
75  _initWidgetFunction( QStringLiteral( "HashLine" ), QgsHashedLineSymbolLayerWidget::create );
76  _initWidgetFunction( QStringLiteral( "ArrowLine" ), QgsArrowSymbolLayerWidget::create );
77  _initWidgetFunction( QStringLiteral( "InterpolatedLine" ), QgsInterpolatedLineSymbolLayerWidget::create );
78 
79  _initWidgetFunction( QStringLiteral( "SimpleMarker" ), QgsSimpleMarkerSymbolLayerWidget::create );
80  _initWidgetFunction( QStringLiteral( "FilledMarker" ), QgsFilledMarkerSymbolLayerWidget::create );
81  _initWidgetFunction( QStringLiteral( "SvgMarker" ), QgsSvgMarkerSymbolLayerWidget::create );
82  _initWidgetFunction( QStringLiteral( "RasterMarker" ), QgsRasterMarkerSymbolLayerWidget::create );
83  _initWidgetFunction( QStringLiteral( "FontMarker" ), QgsFontMarkerSymbolLayerWidget::create );
84  _initWidgetFunction( QStringLiteral( "EllipseMarker" ), QgsEllipseSymbolLayerWidget::create );
85  _initWidgetFunction( QStringLiteral( "VectorField" ), QgsVectorFieldSymbolLayerWidget::create );
86  _initWidgetFunction( QStringLiteral( "MaskMarker" ), QgsMaskMarkerSymbolLayerWidget::create );
87 
88  _initWidgetFunction( QStringLiteral( "SimpleFill" ), QgsSimpleFillSymbolLayerWidget::create );
89  _initWidgetFunction( QStringLiteral( "GradientFill" ), QgsGradientFillSymbolLayerWidget::create );
90  _initWidgetFunction( QStringLiteral( "ShapeburstFill" ), QgsShapeburstFillSymbolLayerWidget::create );
91  _initWidgetFunction( QStringLiteral( "RasterFill" ), QgsRasterFillSymbolLayerWidget::create );
92  _initWidgetFunction( QStringLiteral( "SVGFill" ), QgsSVGFillSymbolLayerWidget::create );
93  _initWidgetFunction( QStringLiteral( "CentroidFill" ), QgsCentroidFillSymbolLayerWidget::create );
94  _initWidgetFunction( QStringLiteral( "LinePatternFill" ), QgsLinePatternFillSymbolLayerWidget::create );
95  _initWidgetFunction( QStringLiteral( "PointPatternFill" ), QgsPointPatternFillSymbolLayerWidget::create );
96  _initWidgetFunction( QStringLiteral( "RandomMarkerFill" ), QgsRandomMarkerFillSymbolLayerWidget::create );
97 
98  _initWidgetFunction( QStringLiteral( "GeometryGenerator" ), QgsGeometryGeneratorSymbolLayerWidget::create );
99 
100  sInitialized = true;
101 }
102 
103 
105  : QgsPanelWidget( parent )
106  , mLayer( layer )
107  , mSymbol( symbol )
108  , mVectorLayer( vl )
109 {
110 
111  setupUi( this );
112  connect( mEnabledCheckBox, &QCheckBox::toggled, this, &QgsLayerPropertiesWidget::mEnabledCheckBox_toggled );
113  // initialize the sub-widgets
114  // XXX Should this thing be here this way? Initialize all the widgets just for the sake of one layer?
115  // TODO Make this on demand creation
116  _initWidgetFunctions();
117 
118  // TODO Algorithm
119  //
120  // 3. populate the combo box with the supported layer type
121  // 4. set the present layer type
122  // 5. create the widget for the present layer type and set in stacked widget
123  // 6. connect comboBox type changed to two things
124  // 1. emit signal that type has beed changed
125  // 2. remove the widget and place the new widget corresponding to the changed layer type
126  //
128  // update layer type combo box
129  const int idx = cboLayerType->findData( mLayer->layerType() );
130  cboLayerType->setCurrentIndex( idx );
131 
132  connect( mEnabledCheckBox, &QAbstractButton::toggled, mEnabledDDBtn, &QWidget::setEnabled );
133  mEnabledCheckBox->setChecked( mLayer->enabled() );
134 
135  // set the corresponding widget
136  updateSymbolLayerWidget( layer );
137  connect( cboLayerType, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsLayerPropertiesWidget::layerTypeChanged );
138 
140 
141  this->connectChildPanel( mEffectWidget );
142 
143  if ( !mLayer->paintEffect() )
144  {
146  mLayer->paintEffect()->setEnabled( false );
147  }
148  mEffectWidget->setPaintEffect( mLayer->paintEffect() );
149 
151 }
152 
154 {
155  mContext = context;
156  if ( mSymbol )
157  mContext.setSymbolType( mSymbol->type() );
158 
159  QgsSymbolLayerWidget *w = dynamic_cast< QgsSymbolLayerWidget * >( stackedWidget->currentWidget() );
160  if ( w )
161  w->setContext( mContext );
162 }
163 
165 {
166  return mContext;
167 }
168 
170 {
172  mEffectWidget->setDockMode( this->dockMode() );
173 }
174 
176 {
177  const QStringList symbolLayerIds = QgsApplication::symbolLayerRegistry()->symbolLayersForType( mSymbol->type() );
178 
179  const auto constSymbolLayerIds = symbolLayerIds;
180  for ( const QString &symbolLayerId : constSymbolLayerIds )
181  cboLayerType->addItem( QgsApplication::symbolLayerRegistry()->symbolLayerMetadata( symbolLayerId )->visibleName(), symbolLayerId );
182 
183  if ( mSymbol->type() == Qgis::SymbolType::Fill )
184  {
186  const auto constLineLayerIds = lineLayerIds;
187  for ( const QString &lineLayerId : constLineLayerIds )
188  {
190  if ( layerInfo->type() != Qgis::SymbolType::Hybrid )
191  {
192  const QString visibleName = layerInfo->visibleName();
193  const QString name = tr( "Outline: %1" ).arg( visibleName );
194  cboLayerType->addItem( name, lineLayerId );
195  }
196  }
197  }
198 }
199 
201 {
202  if ( stackedWidget->currentWidget() != pageDummy )
203  {
204  // stop updating from the original widget
205  if ( QgsSymbolLayerWidget *w = qobject_cast< QgsSymbolLayerWidget * >( stackedWidget->currentWidget() ) )
207  stackedWidget->removeWidget( stackedWidget->currentWidget() );
208  }
209 
211 
212  const QString layerType = layer->layerType();
213  QgsSymbolLayerAbstractMetadata *am = pReg->symbolLayerMetadata( layerType );
214  if ( am )
215  {
217  if ( w )
218  {
219  w->setContext( mContext );
220  w->setSymbolLayer( layer );
221  stackedWidget->addWidget( w );
222  stackedWidget->setCurrentWidget( w );
223  // start receiving updates from widget
225  connect( w, &QgsSymbolLayerWidget::symbolChanged, this, &QgsLayerPropertiesWidget::reloadLayer );
226  return;
227  }
228  }
229  // When anything is not right
230  stackedWidget->setCurrentWidget( pageDummy );
231 }
232 
234 {
235  if ( auto *lExpressionContext = mContext.expressionContext() )
236  return *lExpressionContext;
237 
238  QgsExpressionContext expContext;
242 
243  if ( auto *lMapCanvas = mContext.mapCanvas() )
244  {
245  expContext << QgsExpressionContextUtils::mapSettingsScope( lMapCanvas->mapSettings() )
246  << new QgsExpressionContextScope( lMapCanvas->expressionContextScope() );
247  if ( const QgsExpressionContextScopeGenerator *generator = dynamic_cast< const QgsExpressionContextScopeGenerator * >( lMapCanvas->temporalController() ) )
248  {
249  expContext << generator->createExpressionContextScope();
250  }
251  }
252  else
253  {
255  }
256 
258 
260  if ( mLayer )
261  {
262  //cheat a bit - set the symbol color variable to match the symbol layer's color (when we should really be using the *symbols*
263  //color, but that's not accessible here). 99% of the time these will be the same anyway
265  }
266  expContext << symbolScope;
272  expContext.lastScope()->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "symbol_layer_count" ), 1, true ) );
273  expContext.lastScope()->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "symbol_layer_index" ), 1, true ) );
274  expContext.lastScope()->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "symbol_marker_row" ), 1, true ) );
275  expContext.lastScope()->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "symbol_marker_column" ), 1, true ) );
276 
277  // additional scopes
278  const auto constAdditionalExpressionContextScopes = mContext.additionalExpressionContextScopes();
279  for ( const QgsExpressionContextScope &scope : constAdditionalExpressionContextScopes )
280  {
281  expContext.appendScope( new QgsExpressionContextScope( scope ) );
282  }
283 
284  //TODO - show actual value
285  expContext.setOriginalValueVariable( QVariant() );
286 
292  << QStringLiteral( "symbol_layer_count" ) << QStringLiteral( "symbol_layer_index" ) );
293 
294  return expContext;
295 }
296 
298 {
300  connect( button, &QgsPropertyOverrideButton::changed, this, &QgsLayerPropertiesWidget::updateProperty );
301  button->registerExpressionContextGenerator( this );
302 }
303 
304 void QgsLayerPropertiesWidget::updateProperty()
305 {
306  QgsPropertyOverrideButton *button = qobject_cast<QgsPropertyOverrideButton *>( sender() );
307  const QgsSymbolLayer::Property key = static_cast< QgsSymbolLayer::Property >( button->propertyKey() );
308  mLayer->setDataDefinedProperty( key, button->toProperty() );
309  emit changed();
310 }
311 
313 {
314  QgsSymbolLayer *layer = mLayer;
315  if ( !layer )
316  return;
317  const QString newLayerType = cboLayerType->currentData().toString();
318  if ( layer->layerType() == newLayerType )
319  return;
320 
321  // get creation function for new layer from registry
323  QgsSymbolLayerAbstractMetadata *am = pReg->symbolLayerMetadata( newLayerType );
324  if ( !am ) // check whether the metadata is assigned
325  return;
326 
327  // change layer to a new (with different type)
328  // base new layer on existing layer's properties
329  QgsSymbolLayer *newLayer = am->createSymbolLayer( layer->properties() );
330  if ( !newLayer )
331  return;
332 
333  updateSymbolLayerWidget( newLayer );
334  emit changeLayer( newLayer );
335 }
336 
338 {
339  emit changed();
340 
341  // also update paint effect preview
342  bool paintEffectToggled = false;
343  if ( mLayer->paintEffect() && mLayer->paintEffect()->enabled() )
344  {
345  mLayer->paintEffect()->setEnabled( false );
346  paintEffectToggled = true;
347  }
349  if ( paintEffectToggled )
350  {
351  mLayer->paintEffect()->setEnabled( true );
352  }
353  emit widgetChanged();
354 }
355 
356 void QgsLayerPropertiesWidget::reloadLayer()
357 {
358  emit changeLayer( mLayer );
359 }
360 
361 void QgsLayerPropertiesWidget::mEnabledCheckBox_toggled( bool enabled )
362 {
363  mLayer->setEnabled( enabled );
365 }
@ Line
Line symbol.
@ Fill
Fill symbol.
@ Hybrid
Hybrid symbol.
static QgsSymbolLayerRegistry * symbolLayerRegistry()
Returns the application's symbol layer registry, used for managing symbol layers.
static QgsSymbolLayerWidget * create(QgsVectorLayer *layer)
Static creation method.
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsCentroidFillSymbolLayerWidget.
void changed()
Emitted when the paint effect properties change.
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsSymbolLayerWidget.
Abstract interface for generating an expression context scope.
Single scope for storing variables and functions for use within a QgsExpressionContext.
void addVariable(const QgsExpressionContextScope::StaticVariable &variable)
Adds a variable into the context scope.
static QgsExpressionContextScope * updateSymbolScope(const QgsSymbol *symbol, QgsExpressionContextScope *symbolScope=nullptr)
Updates a symbol scope related to a QgsSymbol to an expression context.
static QgsExpressionContextScope * projectScope(const QgsProject *project)
Creates a new scope which contains variables and functions relating to a QGIS project.
static QgsExpressionContextScope * atlasScope(const QgsLayoutAtlas *atlas)
Creates a new scope which contains variables and functions relating to a QgsLayoutAtlas.
static QgsExpressionContextScope * mapSettingsScope(const QgsMapSettings &mapSettings)
Creates a new scope which contains variables and functions relating to a QgsMapSettings object.
static QgsExpressionContextScope * layerScope(const QgsMapLayer *layer)
Creates a new scope which contains variables and functions relating to a QgsMapLayer.
static QgsExpressionContextScope * globalScope()
Creates a new scope which contains variables and functions relating to the global QGIS context.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
static const QString EXPR_GEOMETRY_PART_COUNT
Inbuilt variable name for geometry part count variable.
static const QString EXPR_GEOMETRY_POINT_COUNT
Inbuilt variable name for point count variable.
static const QString EXPR_CLUSTER_SIZE
Inbuilt variable name for cluster size variable.
static const QString EXPR_GEOMETRY_POINT_NUM
Inbuilt variable name for point number variable.
void setOriginalValueVariable(const QVariant &value)
Sets the original value variable value for the context.
static const QString EXPR_GEOMETRY_RING_NUM
Inbuilt variable name for geometry ring number variable.
static const QString EXPR_GEOMETRY_PART_NUM
Inbuilt variable name for geometry part number variable.
static const QString EXPR_SYMBOL_COLOR
Inbuilt variable name for symbol color variable.
QgsExpressionContextScope * lastScope()
Returns the last scope added to the context.
void appendScope(QgsExpressionContextScope *scope)
Appends a scope to the end of the context.
void setHighlightedVariables(const QStringList &variableNames)
Sets the list of variable names within the context intended to be highlighted to the user.
static const QString EXPR_ORIGINAL_VALUE
Inbuilt variable name for value original value variable.
static const QString EXPR_CLUSTER_COLOR
Inbuilt variable name for cluster color variable.
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsFilledMarkerSymbolLayerWidget.
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsFontMarkerSymbolLayerWidget.
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Will be registered as factory.
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsGradientFillSymbolLayerWidget.
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsHashedLineSymbolLayerWidget.
static QgsSymbolLayerWidget * create(QgsVectorLayer *layer)
Static creation method.
QgsLayerPropertiesWidget(QgsSymbolLayer *layer, const QgsSymbol *symbol, QgsVectorLayer *vl, QWidget *parent=nullptr)
Constructor for QgsLayerPropertiesWidget.
void setDockMode(bool dockMode) override
Set the widget in dock mode which tells the widget to emit panel widgets and not open dialogs.
QgsSymbolWidgetContext context() const
Returns the context in which the symbol widget is shown, e.g., the associated map canvas and expressi...
QgsExpressionContext createExpressionContext() const override
This method needs to be reimplemented in all classes which implement this interface and return an exp...
void setContext(const QgsSymbolWidgetContext &context)
Sets the context in which the symbol widget is shown, e.g., the associated map canvas and expression ...
void changeLayer(QgsSymbolLayer *)
void updateSymbolLayerWidget(QgsSymbolLayer *layer)
void registerDataDefinedButton(QgsPropertyOverrideButton *button, QgsSymbolLayer::Property key)
Registers a data defined override button.
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsLinePatternFillSymbolLayerWidget.
The QgsMapSettings class contains configuration for rendering of the map.
Struct for storing maximum and minimum scales for measurements in map units.
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsMarkerLineSymbolLayerWidget.
static QgsSymbolLayerWidget * create(QgsVectorLayer *layer)
Static creation method.
static QgsPaintEffect * defaultStack()
Returns a new effect stack consisting of a sensible selection of default effects.
void setEnabled(bool enabled)
Sets whether the effect is enabled.
bool enabled() const
Returns whether the effect is enabled.
Base class for any widget that can be shown as a inline panel.
void connectChildPanel(QgsPanelWidget *panel)
Connect the given sub panel widgets showPanel signals to this current panels main showPanel event to ...
void widgetChanged()
Emitted when the widget state changes.
virtual void setDockMode(bool dockMode)
Set the widget in dock mode which tells the widget to emit panel widgets and not open dialogs.
bool dockMode()
Returns the dock mode state.
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsPointPatternFillSymbolLayerWidget.
static QgsProject * instance()
Returns the QgsProject singleton instance.
Definition: qgsproject.cpp:467
A button for controlling property overrides which may apply to a widget.
QgsProperty toProperty() const
Returns a QgsProperty object encapsulating the current state of the widget.
void changed()
Emitted when property definition changes.
void init(int propertyKey, const QgsProperty &property, const QgsPropertiesDefinition &definitions, const QgsVectorLayer *layer=nullptr, bool auxiliaryStorageEnabled=false)
Initialize a newly constructed property button (useful if button was included in a UI layout).
void registerExpressionContextGenerator(QgsExpressionContextGenerator *generator)
Register an expression context generator class that will be used to retrieve an expression context fo...
int propertyKey() const
Returns the property key linked to the button.
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsRandomMarkerFillSymbolLayerWidget.
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsRasterFillSymbolLayerWidget.
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsRasterMarkerSymbolLayerWidget.
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsSVGFillSymbolLayerWidget.
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsShapeburstFillSymbolLayerWidget.
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsSimpleFillSymbolLayerWidget.
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsSimpleLineSymbolLayerWidget.
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsSimpleMarkerSymbolLayerWidget.
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsSvgMarkerSymbolLayerWidget.
Stores metadata about one symbol layer class.
virtual QgsSymbolLayer * createSymbolLayer(const QVariantMap &map)=0
Create a symbol layer of this type given the map of properties.
virtual QgsSymbolLayerWidget * createSymbolLayerWidget(QgsVectorLayer *)
Create widget for symbol layer of this type. Can return nullptr if there's no GUI.
Convenience metadata class that uses static functions to create symbol layer and its widget.
void setWidgetFunction(QgsSymbolLayerWidgetFunc f)
Registry of available symbol layer classes.
QStringList symbolLayersForType(Qgis::SymbolType type)
Returns a list of available symbol layers for a specified symbol type.
QgsSymbolLayerAbstractMetadata * symbolLayerMetadata(const QString &name) const
Returns metadata for specified symbol layer. Returns nullptr if not found.
static QPicture symbolLayerPreviewPicture(const QgsSymbolLayer *layer, QgsUnitTypes::RenderUnit units, QSize size, const QgsMapUnitScale &scale=QgsMapUnitScale(), Qgis::SymbolType parentSymbolType=Qgis::SymbolType::Hybrid)
Draws a symbol layer preview to a QPicture.
virtual void setSymbolLayer(QgsSymbolLayer *layer)=0
void changed()
Should be emitted whenever configuration changes happened on this symbol layer configuration.
void symbolChanged()
Should be emitted whenever the sub symbol changed on this symbol layer configuration.
virtual void setContext(const QgsSymbolWidgetContext &context)
Sets the context in which the symbol widget is shown, e.g., the associated map canvas and expression ...
Property
Data definable properties.
@ PropertyLayerEnabled
Whether symbol layer is enabled.
virtual QColor color() const
The fill color.
void setPaintEffect(QgsPaintEffect *effect)
Sets the current paint effect for the layer.
QgsPaintEffect * paintEffect() const
Returns the current paint effect for the layer.
void setEnabled(bool enabled)
Sets whether symbol layer is enabled and should be drawn.
virtual QVariantMap properties() const =0
Should be reimplemented by subclasses to return a string map that contains the configuration informat...
bool enabled() const
Returns true if symbol layer is enabled and will be drawn.
virtual QString layerType() const =0
Returns a string that represents this layer type.
virtual void setDataDefinedProperty(Property key, const QgsProperty &property)
Sets a data defined property for the layer.
static const QgsPropertiesDefinition & propertyDefinitions()
Returns the symbol layer property definitions.
QgsPropertyCollection & dataDefinedProperties()
Returns a reference to the symbol layer's property collection, used for data defined overrides.
Contains settings which reflect the context in which a symbol (or renderer) widget is shown,...
QList< QgsExpressionContextScope > additionalExpressionContextScopes() const
Returns the list of additional expression context scopes to show as available within the layer.
void setSymbolType(Qgis::SymbolType type)
Sets the associated symbol type, if the widget is being shown as a subcomponent of a parent symbol co...
QgsExpressionContext * expressionContext() const
Returns the expression context used for the widget, if set.
QgsMapCanvas * mapCanvas() const
Returns the map canvas associated with the widget.
Abstract base class for all rendered symbols.
Definition: qgssymbol.h:38
Qgis::SymbolType type() const
Returns the symbol's type.
Definition: qgssymbol.h:97
@ RenderMillimeters
Millimeters.
Definition: qgsunittypes.h:169
static QgsSymbolLayerWidget * create(QgsVectorLayer *vl)
Creates a new QgsVectorFieldSymbolLayerWidget.
Represents a vector layer which manages a vector based data sets.
#define QgsDebugMsg(str)
Definition: qgslogger.h:38
QgsSymbolLayerWidget *(* QgsSymbolLayerWidgetFunc)(QgsVectorLayer *)
Single variable definition for use within a QgsExpressionContextScope.