24#include "moc_qgsembeddedsymbolrendererwidget.cpp"
45 mRenderer.reset(
nullptr );
46 QGridLayout *layout =
new QGridLayout(
this );
47 QLabel *label =
new QLabel(
49 "The embedded symbols renderer can only be used with layers\n"
50 "containing embedded styling information.\n\n"
51 "'%1' does not contain embedded styling and cannot be displayed."
53 .arg( layer->
name() ),
56 this->setLayout( layout );
57 layout->addWidget( label );
58 mDefaultSymbolToolButton =
nullptr;
76 renderer->copyRendererData( mRenderer.get() );
79 mDefaultSymbolToolButton->setSymbol( mRenderer->defaultSymbol()->clone() );
80 mDefaultSymbolToolButton->setDialogTitle( tr(
"Default symbol" ) );
81 mDefaultSymbolToolButton->setLayer(
mLayer );
82 mDefaultSymbolToolButton->registerExpressionContextGenerator(
this );
85 mRenderer->setDefaultSymbol( mDefaultSymbolToolButton->symbol()->clone() );
94 return mRenderer.get();
100 if ( mDefaultSymbolToolButton )
102 mDefaultSymbolToolButton->setMapCanvas(
context.mapCanvas() );
103 mDefaultSymbolToolButton->setMessageBar(
context.messageBar() );
115 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...