15#ifndef QGSCATEGORIZEDSYMBOLRENDERER_H
16#define QGSCATEGORIZEDSYMBOLRENDERER_H
71 QVariant value()
const;
84 QString label()
const;
93 void setValue(
const QVariant &value );
109 void setLabel(
const QString &label );
116 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() );
183 QSet<QString> usedAttributes(
const QgsRenderContext &context )
const override;
184 bool filterNeedsGeometry()
const override;
185 QString dump()
const override;
187 void toSld( QDomDocument &doc, QDomElement &element, const QVariantMap &props = QVariantMap() ) const override;
209 int categoryIndexForValue(
const QVariant &val );
215 int categoryIndexForLabel(
const QString &val );
226 bool updateCategoryValue(
int catIndex,
const QVariant &value );
249 bool updateCategoryLabel(
int catIndex,
const QString &label );
263 bool updateCategoryRenderState(
int catIndex,
bool render );
277 bool deleteCategory(
int catIndex );
284 void deleteAllCategories();
289 void moveCategory(
int from,
int to );
296 void sortByValue( Qt::SortOrder order = Qt::AscendingOrder );
303 void sortByLabel( Qt::SortOrder order = Qt::AscendingOrder );
331 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(); }
441 int matchToSymbols(
QgsStyle *style,
Qgis::SymbolType type,
442 QVariantList &unmatchedCategories
SIP_OUT, QStringList &unmatchedSymbols
SIP_OUT,
bool caseSensitive = true,
bool useTolerantMatch = false );
466 static QString displayString( const QVariant &value,
int precision = -1 );
483 bool mCounting = false;
The Qgis class provides global constants for use throughout the application.
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.
Class for parsing and evaluation of expressions (formerly called "search strings").
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Container of fields for a vector layer.
The class is used as a container of context for various read/write operations on other 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
Constructor for QgsRendererCategory.
An interface for classes which can visit style entity (e.g.
Abstract base class for all rendered symbols.
Represents a vector layer which manages a vector based data sets.
std::unique_ptr< GEOSGeometry, GeosDeleter > unique_ptr
Scoped GEOS pointer.
QList< QgsRendererCategory > QgsCategoryList
QList< QgsLegendSymbolItem > QgsLegendSymbolList
QList< QgsSymbol * > QgsSymbolList