16#include "moc_qgssinglesymbolrendererwidget.cpp"
52 mRenderer = std::make_unique<QgsSingleSymbolRenderer>( symbol );
60 mSingleSymbol.reset( mRenderer->symbol()->clone() );
67 QVBoxLayout *layout =
new QVBoxLayout(
this );
68 layout->setContentsMargins( 0, 0, 0, 0 );
69 layout->addWidget( mSelector );
74 mActionLevels = advMenu->addAction( tr(
"Symbol Levels…" ) );
75 connect( mActionLevels, &QAction::triggered,
this, &QgsSingleSymbolRendererWidget::showSymbolLevels );
78 QAction *actionDdsLegend = advMenu->addAction( tr(
"Data-defined Size Legend…" ) );
79 connect( actionDdsLegend, &QAction::triggered,
this, &QgsSingleSymbolRendererWidget::dataDefinedSizeLegend );
85 mSingleSymbol.reset();
93 return mRenderer.get();
112 delete mActionLevels;
113 mActionLevels =
nullptr;
118 mSingleSymbol.reset( levels.at( 0 ).symbol()->clone() );
125 mRenderer->setSymbol( mSingleSymbol->clone() );
126 mRenderer->setUsingSymbolLevels( enabled );
131void QgsSingleSymbolRendererWidget::changeSingleSymbol()
134 mRenderer->setSymbol( mSingleSymbol->clone() );
137 mRenderer->setUsingSymbolLevels(
true );
142void QgsSingleSymbolRendererWidget::showSymbolLevels()
147void QgsSingleSymbolRendererWidget::dataDefinedSizeLegend()
QFlags< SymbolFlag > SymbolFlags
Symbol flags.
@ RendererShouldUseSymbolLevels
If present, indicates that a QgsFeatureRenderer using the symbol should use symbol levels for best re...
Abstract base class for all 2D vector feature renderers.
void copyRendererData(QgsFeatureRenderer *destRenderer) const
Clones generic renderer data to another renderer.
A marker symbol type, for rendering Point and MultiPoint geometries.
static QgsSingleSymbolRenderer * convertFromRenderer(const QgsFeatureRenderer *renderer)
Creates a new single symbol renderer from an existing renderer.
Contains settings which reflect the context in which a symbol (or renderer) widget is shown,...
Abstract base class for all rendered symbols.
static QgsSymbol * defaultSymbol(Qgis::GeometryType geomType)
Returns a new default symbol for the specified geometry type.
Represents a vector layer which manages a vector based data sets.
Q_INVOKABLE Qgis::GeometryType geometryType() const
Returns point, line or polygon.