QGIS API Documentation  3.20.0-Odense (decaadbb31)
Public Member Functions | List of all members
QgsSymbolWidgetContext Class Reference

Contains settings which reflect the context in which a symbol (or renderer) widget is shown, e.g., the map canvas and relevant expression contexts. More...

#include <qgssymbolwidgetcontext.h>

Public Member Functions

 QgsSymbolWidgetContext ()=default
 Constructor for QgsSymbolWidgetContext. More...
 
 QgsSymbolWidgetContext (const QgsSymbolWidgetContext &other)
 Copy constructor. More...
 
QList< QgsExpressionContextScopeadditionalExpressionContextScopes () const
 Returns the list of additional expression context scopes to show as available within the layer. More...
 
QgsExpressionContextexpressionContext () const
 Returns the expression context used for the widget, if set. More...
 
QList< QgsExpressionContextScope * > globalProjectAtlasMapLayerScopes (const QgsMapLayer *layer) const
 Returns list of scopes: global, project, atlas, map, layer. More...
 
QgsMapCanvasmapCanvas () const
 Returns the map canvas associated with the widget. More...
 
QgsMessageBarmessageBar () const
 Returns the message bar associated with the widget. More...
 
QgsSymbolWidgetContextoperator= (const QgsSymbolWidgetContext &other)
 
void setAdditionalExpressionContextScopes (const QList< QgsExpressionContextScope > &scopes)
 Sets a list of additional expression context scopes to show as available within the layer. More...
 
void setExpressionContext (QgsExpressionContext *context)
 Sets the optional expression context used for the widget. More...
 
void setMapCanvas (QgsMapCanvas *canvas)
 Sets the map canvas associated with the widget. More...
 
void setMessageBar (QgsMessageBar *bar)
 Sets the message bar associated with the widget. More...
 
void setSymbolType (Qgis::SymbolType type)
 Sets the associated symbol type, if the widget is being shown as a subcomponent of a parent symbol configuration widget. More...
 
Qgis::SymbolType symbolType () const
 Returns the associated symbol type, if the widget is being shown as a subcomponent of a parent symbol configuration widget. More...
 

Detailed Description

Contains settings which reflect the context in which a symbol (or renderer) widget is shown, e.g., the map canvas and relevant expression contexts.

Since
QGIS 3.0

Definition at line 35 of file qgssymbolwidgetcontext.h.

Constructor & Destructor Documentation

◆ QgsSymbolWidgetContext() [1/2]

QgsSymbolWidgetContext::QgsSymbolWidgetContext ( )
default

Constructor for QgsSymbolWidgetContext.

◆ QgsSymbolWidgetContext() [2/2]

QgsSymbolWidgetContext::QgsSymbolWidgetContext ( const QgsSymbolWidgetContext other)

Copy constructor.

Parameters
othersource QgsSymbolWidgetContext

Definition at line 22 of file qgssymbolwidgetcontext.cpp.

Member Function Documentation

◆ additionalExpressionContextScopes()

QList< QgsExpressionContextScope > QgsSymbolWidgetContext::additionalExpressionContextScopes ( ) const

Returns the list of additional expression context scopes to show as available within the layer.

See also
setAdditionalExpressionContextScopes()

Definition at line 87 of file qgssymbolwidgetcontext.cpp.

◆ expressionContext()

QgsExpressionContext * QgsSymbolWidgetContext::expressionContext ( ) const

Returns the expression context used for the widget, if set.

This expression context is used for evaluating data defined symbol properties and for populating based expression widgets in the layer widget.

See also
setExpressionContext()

Definition at line 77 of file qgssymbolwidgetcontext.cpp.

◆ globalProjectAtlasMapLayerScopes()

QList< QgsExpressionContextScope * > QgsSymbolWidgetContext::globalProjectAtlasMapLayerScopes ( const QgsMapLayer layer) const

Returns list of scopes: global, project, atlas, map, layer.

Ownership is transferred to the caller.

Since
QGIS 3.0

Definition at line 92 of file qgssymbolwidgetcontext.cpp.

◆ mapCanvas()

QgsMapCanvas * QgsSymbolWidgetContext::mapCanvas ( ) const

Returns the map canvas associated with the widget.

See also
setMapCanvas()

Definition at line 54 of file qgssymbolwidgetcontext.cpp.

◆ messageBar()

QgsMessageBar * QgsSymbolWidgetContext::messageBar ( ) const

Returns the message bar associated with the widget.

See also
setMessageBar()
Since
QGIS 3.6

Definition at line 64 of file qgssymbolwidgetcontext.cpp.

◆ operator=()

QgsSymbolWidgetContext & QgsSymbolWidgetContext::operator= ( const QgsSymbolWidgetContext other)

Definition at line 33 of file qgssymbolwidgetcontext.cpp.

◆ setAdditionalExpressionContextScopes()

void QgsSymbolWidgetContext::setAdditionalExpressionContextScopes ( const QList< QgsExpressionContextScope > &  scopes)

Sets a list of additional expression context scopes to show as available within the layer.

Parameters
scopeslist of additional scopes which will be added in order to the end of the default expression context
See also
setExpressionContext()

Definition at line 82 of file qgssymbolwidgetcontext.cpp.

◆ setExpressionContext()

void QgsSymbolWidgetContext::setExpressionContext ( QgsExpressionContext context)

Sets the optional expression context used for the widget.

This expression context is used for evaluating data defined symbol properties and for populating based expression widgets in the layer widget.

Parameters
contextexpression context pointer. Ownership is not transferred.
See also
expressionContext()
setAdditionalExpressionContextScopes()

Definition at line 69 of file qgssymbolwidgetcontext.cpp.

◆ setMapCanvas()

void QgsSymbolWidgetContext::setMapCanvas ( QgsMapCanvas canvas)

Sets the map canvas associated with the widget.

This allows the widget to retrieve the current map scale and other properties from the canvas.

Parameters
canvasmap canvas
See also
mapCanvas()

Definition at line 49 of file qgssymbolwidgetcontext.cpp.

◆ setMessageBar()

void QgsSymbolWidgetContext::setMessageBar ( QgsMessageBar bar)

Sets the message bar associated with the widget.

This allows the widget to push feedback messages to the appropriate message bar.

See also
messageBar()
Since
QGIS 3.6

Definition at line 59 of file qgssymbolwidgetcontext.cpp.

◆ setSymbolType()

void QgsSymbolWidgetContext::setSymbolType ( Qgis::SymbolType  type)

Sets the associated symbol type, if the widget is being shown as a subcomponent of a parent symbol configuration widget.

See also
symbolType()
Since
QGIS 3.18

Definition at line 123 of file qgssymbolwidgetcontext.cpp.

◆ symbolType()

Qgis::SymbolType QgsSymbolWidgetContext::symbolType ( ) const

Returns the associated symbol type, if the widget is being shown as a subcomponent of a parent symbol configuration widget.

See also
setSymbolType()
Since
QGIS 3.18

Definition at line 118 of file qgssymbolwidgetcontext.cpp.


The documentation for this class was generated from the following files: