26 : mMapCanvas( other.mMapCanvas )
27 , mMessageBar( other.mMessageBar )
28 , mAdditionalScopes( other.mAdditionalScopes )
29 , mSymbolType( other.mSymbolType )
31 if ( other.mExpressionContext )
33 mExpressionContext = std::make_unique<QgsExpressionContext>( *other.mExpressionContext );
42 mMapCanvas = other.mMapCanvas;
43 mMessageBar = other.mMessageBar;
44 mAdditionalScopes = other.mAdditionalScopes;
45 mSymbolType = other.mSymbolType;
46 if ( other.mExpressionContext )
48 mExpressionContext = std::make_unique<QgsExpressionContext>( *other.mExpressionContext );
52 mExpressionContext.reset();
80 mExpressionContext = std::make_unique<QgsExpressionContext>( *context );
82 mExpressionContext.reset();
87 return mExpressionContext.get();
92 mAdditionalScopes = scopes;
97 return mAdditionalScopes;
102 std::vector<std::unique_ptr<QgsExpressionContextScope>> scopes;
109 scopes.push_back( mMapCanvas->defaultExpressionContextScope() );
110 scopes.push_back( std::make_unique<QgsExpressionContextScope>( mMapCanvas->expressionContextScope() ) );
114 scopes.push_back( std::unique_ptr<QgsExpressionContextScope>( generator->createExpressionContextScope() ) );
Abstract interface for generating an expression context scope.
static std::unique_ptr< QgsExpressionContextScope > globalScope()
Creates a new scope which contains variables and functions relating to the global QGIS context.
static std::unique_ptr< QgsExpressionContextScope > layerScope(const QgsMapLayer *layer)
Creates a new scope which contains variables and functions relating to a QgsMapLayer.
static std::unique_ptr< QgsExpressionContextScope > mapSettingsScope(const QgsMapSettings &mapSettings)
Creates a new scope which contains variables and functions relating to a QgsMapSettings object.
static std::unique_ptr< QgsExpressionContextScope > atlasScope(const QgsLayoutAtlas *atlas)
Creates a new scope which contains variables and functions relating to a QgsLayoutAtlas.
static std::unique_ptr< QgsExpressionContextScope > projectScope(const QgsProject *project)
Creates a new scope which contains variables and functions relating to a QGIS project.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Map canvas is a class for displaying all GIS data types on a canvas.
Base class for all map layer types.
Contains configuration for rendering maps.
A bar for displaying non-blocking messages to the user.
static QgsProject * instance()
Returns the QgsProject singleton instance.
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...
void setMapCanvas(QgsMapCanvas *canvas)
Sets the map canvas associated with the widget.
std::vector< std::unique_ptr< QgsExpressionContextScope > > globalProjectAtlasMapLayerScopes(const QgsMapLayer *layer) const
Returns list of scopes: global, project, atlas, map, layer.
void setAdditionalExpressionContextScopes(const QList< QgsExpressionContextScope > &scopes)
Sets a list of additional expression context scopes to show as available within the layer.
QgsSymbolWidgetContext & operator=(const QgsSymbolWidgetContext &other)
void setMessageBar(QgsMessageBar *bar)
Sets the message bar associated with the widget.
QgsSymbolWidgetContext()=default
void setExpressionContext(QgsExpressionContext *context)
Sets the optional expression context used for the widget.
QgsExpressionContext * expressionContext() const
Returns the expression context used for the widget, if set.
QgsMapCanvas * mapCanvas() const
Returns the map canvas associated with the widget.
Qgis::SymbolType symbolType() const
Returns the associated symbol type, if the widget is being shown as a subcomponent of a parent symbol...
QgsMessageBar * messageBar() const
Returns the message bar associated with the widget.