15#ifndef QGSCATEGORIZEDSYMBOLRENDERER_H
16#define QGSCATEGORIZEDSYMBOLRENDERER_H
73 QVariant value()
const;
86 QString label()
const;
95 void setValue(
const QVariant &value );
111 void setLabel(
const QString &label );
117 bool renderState()
const;
123 void setRenderState(
bool render );
130 QString dump()
const;
135 void toSld( QDomDocument &doc, QDomElement &element, QVariantMap props )
const;
138 SIP_PYOBJECT __repr__();
140 const QString str = !sipCpp->value().isValid()
141 ? QStringLiteral(
"<QgsRendererCategory>" )
142 : sipCpp->label().isEmpty()
143 ? QStringLiteral(
"<QgsRendererCategory: %1>" ).arg( sipCpp->value().toString() )
144 : QStringLiteral(
"<QgsRendererCategory: %1 (%2)>" ).arg( sipCpp->value().toString(), sipCpp->label() );
145 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
186 QSet<QString> usedAttributes(
const QgsRenderContext &context )
const override;
187 bool filterNeedsGeometry()
const override;
188 QString dump()
const override;
190 void toSld( QDomDocument &doc, QDomElement &element, const QVariantMap &props = QVariantMap() ) const override;
212 int categoryIndexForValue(
const QVariant &val );
217 int categoryIndexForLabel(
const QString &val );
228 bool updateCategoryValue(
int catIndex,
const QVariant &value );
251 bool updateCategoryLabel(
int catIndex,
const QString &label );
264 bool updateCategoryRenderState(
int catIndex,
bool render );
278 bool deleteCategory(
int catIndex );
285 void deleteAllCategories();
290 void moveCategory(
int from,
int to );
297 void sortByValue( Qt::SortOrder order = Qt::AscendingOrder );
304 void sortByLabel( Qt::SortOrder order = Qt::AscendingOrder );
332 QString legendKeyToExpression(
const QString &key,
QgsVectorLayer *layer,
bool &ok )
const override;
389 bool legendSymbolItemsCheckable() const override;
390 bool legendSymbolItemChecked( const QString &key ) override;
392 void checkLegendSymbolItem( const QString &key,
bool state = true ) override;
393 QString legendClassificationAttribute()
const override {
return classAttribute(); }
438 int matchToSymbols(
QgsStyle *style,
Qgis::SymbolType type,
439 QVariantList &unmatchedCategories
SIP_OUT, QStringList &unmatchedSymbols
SIP_OUT,
bool caseSensitive = true,
bool useTolerantMatch = false );
463 static QString displayString( const QVariant &value,
int precision = -1 );
480 bool mCounting = false;
Provides global constants and enumerations for use throughout the application.
QFlags< FeatureRendererFlag > FeatureRendererFlags
Flags controlling behavior of vector feature renderers.
A feature renderer which represents features using a list of renderer categories.
const QgsCategoryList & categories() const
Returns a list of all categories recognized by the renderer.
QString classAttribute() const
Returns the class attribute for the renderer, which is the field name or expression string from the l...
void setClassAttribute(const QString &attr)
Sets the class attribute for the renderer, which is the field name or expression string from the laye...
~QgsCategorizedSymbolRenderer() override
Abstract base class for color ramps.
Object that keeps configuration of appearance of marker symbol's data-defined size in legend.
Handles parsing and evaluation of expressions (formerly called "search strings").
Abstract base class for all 2D vector feature renderers.
QFlags< Capability > Capabilities
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Container of fields for a vector layer.
A container for the context for various read/write operations on objects.
Contains information about the context of a rendering operation.
Represents an individual category (class) from a QgsCategorizedSymbolRenderer.
std::unique_ptr< QgsSymbol > mSymbol
QgsRendererCategory()=default
An interface for classes which can visit style entity (e.g.
A database of saved style entities, including symbols, color ramps, text formats and others.
Abstract base class for all rendered symbols.
Represents a vector layer which manages a vector based dataset.
QList< QgsRendererCategory > QgsCategoryList
QList< QgsLegendSymbolItem > QgsLegendSymbolList
QList< QgsSymbol * > QgsSymbolList