24#include "moc_qgsembeddedsymbolrendererwidget.cpp"
45 mRenderer.reset(
nullptr );
46 QGridLayout *layout =
new QGridLayout(
this );
47 QLabel *label =
new QLabel( tr(
"The embedded symbols renderer can only be used with layers\n"
48 "containing embedded styling information.\n\n"
49 "'%1' does not contain embedded styling and cannot be displayed." )
50 .arg( layer->
name() ),
52 this->setLayout( layout );
53 layout->addWidget( label );
54 mDefaultSymbolToolButton =
nullptr;
72 renderer->copyRendererData( mRenderer.get() );
75 mDefaultSymbolToolButton->setSymbol( mRenderer->defaultSymbol()->clone() );
76 mDefaultSymbolToolButton->setDialogTitle( tr(
"Default symbol" ) );
77 mDefaultSymbolToolButton->setLayer(
mLayer );
78 mDefaultSymbolToolButton->registerExpressionContextGenerator(
this );
81 mRenderer->setDefaultSymbol( mDefaultSymbolToolButton->symbol()->clone() );
90 return mRenderer.get();
96 if ( mDefaultSymbolToolButton )
98 mDefaultSymbolToolButton->setMapCanvas(
context.mapCanvas() );
99 mDefaultSymbolToolButton->setMessageBar(
context.messageBar() );
111 const QList<QgsExpressionContextScope> scopes =
mContext.additionalExpressionContextScopes();
@ FeatureSymbology
Provider is able retrieve embedded symbology associated with individual features.
GeometryType
The geometry types are used to group Qgis::WkbType in a coarse way.
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...
Abstract base class for all 2D vector feature renderers.
A database of saved style entities, including symbols, color ramps, text formats and others.
Contains settings which reflect the context in which a symbol (or renderer) widget is shown,...
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.
virtual Q_INVOKABLE Qgis::VectorProviderCapabilities capabilities() const
Returns flags containing the supported capabilities.
Represents a vector layer which manages a vector based dataset.
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...