40 mRenderer.reset(
nullptr );
41 QGridLayout *layout =
new QGridLayout(
this );
42 QLabel *label =
new QLabel( tr(
"The embedded symbols renderer can only be used with layers\n"
43 "containing embedded styling information.\n\n"
44 "'%1' does not contain embedded styling and cannot be displayed." )
45 .arg( layer->
name() ),
this );
46 this->setLayout( layout );
47 layout->addWidget( label );
48 mDefaultSymbolToolButton =
nullptr;
69 mDefaultSymbolToolButton->setSymbol( mRenderer->defaultSymbol()->clone() );
70 mDefaultSymbolToolButton->setDialogTitle( tr(
"Default symbol" ) );
71 mDefaultSymbolToolButton->setLayer(
mLayer );
72 mDefaultSymbolToolButton->registerExpressionContextGenerator(
this );
76 mRenderer->setDefaultSymbol( mDefaultSymbolToolButton->symbol()->clone() );
85 return mRenderer.get();
91 if ( mDefaultSymbolToolButton )
GeometryType
The geometry types are used to group Qgis::WkbType in a coarse way.
A vector feature renderer which uses embedded feature symbology to render per-feature symbols.
static QgsEmbeddedSymbolRenderer * convertFromRenderer(const QgsFeatureRenderer *renderer)
Creates a QgsEmbeddedSymbolRenderer from an existing renderer.
Single scope for storing variables and functions for use within a QgsExpressionContext.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
void copyRendererData(QgsFeatureRenderer *destRenderer) const
Clones generic renderer data to another renderer.
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.
QList< QgsExpressionContextScope * > globalProjectAtlasMapLayerScopes(const QgsMapLayer *layer) const
Returns list of scopes: global, project, atlas, map, layer.
QgsExpressionContext * expressionContext() const
Returns the expression context used for the widget, if set.
QgsMapCanvas * mapCanvas() const
Returns the map canvas associated with the widget.
QgsMessageBar * messageBar() const
Returns the message bar associated with the widget.
static Qgis::SymbolType symbolTypeForGeometryType(Qgis::GeometryType type)
Returns the default symbol type required for the specified geometry type.
static QgsSymbol * defaultSymbol(Qgis::GeometryType geomType)
Returns a new default symbol for the specified geometry type.
@ FeatureSymbology
Provider is able retrieve embedded symbology associated with individual features. Since QGIS 3....
virtual Q_INVOKABLE QgsVectorDataProvider::Capabilities capabilities() const
Returns flags containing the supported capabilities.
Represents a vector layer which manages a vector based data sets.
Q_INVOKABLE Qgis::WkbType wkbType() const FINAL
Returns the WKBType or WKBUnknown in case of error.
QgsVectorDataProvider * dataProvider() FINAL
Returns the layer's data provider, it may be nullptr.
static Qgis::GeometryType geometryType(Qgis::WkbType type)
Returns the geometry type for a WKB type, e.g., both MultiPolygon and CurvePolygon would have a Polyg...