34 #include <QDomDocument> 35 #include <QDomElement> 115 if ( !
mSymbol.get() || props.value( QStringLiteral(
"attribute" ), QString() ).isEmpty() )
118 QString attrName = props[ QStringLiteral(
"attribute" )];
120 QDomElement ruleElem = doc.createElement( QStringLiteral(
"se:Rule" ) );
121 element.appendChild( ruleElem );
123 QDomElement nameElem = doc.createElement( QStringLiteral(
"se:Name" ) );
124 nameElem.appendChild( doc.createTextNode(
mLabel ) );
125 ruleElem.appendChild( nameElem );
127 QDomElement descrElem = doc.createElement( QStringLiteral(
"se:Description" ) );
128 QDomElement titleElem = doc.createElement( QStringLiteral(
"se:Title" ) );
129 QString descrStr = QStringLiteral(
"%1 is '%2'" ).arg( attrName,
mValue.toString() );
130 titleElem.appendChild( doc.createTextNode( !
mLabel.isEmpty() ?
mLabel : descrStr ) );
131 descrElem.appendChild( titleElem );
132 ruleElem.appendChild( descrElem );
138 filterFunc = QStringLiteral(
"%1 = '%2' or %1 is null" )
139 .arg( attrName.replace(
'\"', QLatin1String(
"\"\"" ) ),
140 mValue.toString().replace(
'\'', QLatin1String(
"''" ) ) );
144 filterFunc = QStringLiteral(
"%1 = '%2'" )
145 .arg( attrName.replace(
'\"', QLatin1String(
"\"\"" ) ),
146 mValue.toString().replace(
'\'', QLatin1String(
"''" ) ) );
154 mSymbol->toSld( doc, ruleElem, props );
161 , mAttrName( attrName )
170 QgsDebugMsg( QStringLiteral(
"invalid symbol in a category! ignoring..." ) );
200 foundMatchingSymbol =
false;
203 QHash<QString, QgsSymbol *>::const_iterator it =
mSymbolHash.constFind( value.isNull() ? QString() : value.toString() );
208 QgsDebugMsg( QStringLiteral(
"there are no hashed symbols!!!" ) );
217 foundMatchingSymbol =
true;
247 QVariant value = valueForFeature( feature, context );
249 bool foundCategory =
false;
253 if ( !foundCategory )
291 if ( catIndex < 0 || catIndex >=
mCategories.size() )
299 if ( catIndex < 0 || catIndex >=
mCategories.size() )
307 if ( catIndex < 0 || catIndex >=
mCategories.size() )
315 if ( catIndex < 0 || catIndex >=
mCategories.size() )
325 QgsDebugMsg( QStringLiteral(
"invalid symbol in a category! ignoring..." ) );
334 if ( catIndex < 0 || catIndex >=
mCategories.size() )
363 if ( order == Qt::AscendingOrder )
375 return QString::localeAwareCompare( c1.
label(), c2.
label() ) < 0;
385 if ( order == Qt::AscendingOrder )
431 QSet<QString> attributes;
443 QgsCategoryList::const_iterator catIt =
mCategories.constBegin();
470 QString s = QStringLiteral(
"CATEGORIZED: idx %1\n" ).arg(
mAttrName );
495 newProps[ QStringLiteral(
"attribute" )] =
mAttrName;
500 it->toSld( doc, element, newProps );
507 bool isExpression = ( attrNum == -1 );
509 bool hasDefault =
false;
510 bool defaultActive =
false;
511 bool allActive =
true;
512 bool noneActive =
true;
516 QString activeValues;
517 QString inactiveValues;
521 if ( cat.
value() ==
"" )
530 QVariant::Type valType = isExpression ? cat.
value().type() : fields.
at( attrNum ).
type();
535 if ( cat.
value() !=
"" )
537 if ( !inactiveValues.isEmpty() )
538 inactiveValues.append(
',' );
540 inactiveValues.append( value );
545 if ( cat.
value() !=
"" )
547 if ( !activeValues.isEmpty() )
548 activeValues.append(
',' );
550 activeValues.append( value );
555 QString attr = isExpression ?
mAttrName : QStringLiteral(
"\"%1\"" ).arg(
mAttrName );
557 if ( allActive && hasDefault )
561 else if ( noneActive )
563 return QStringLiteral(
"FALSE" );
565 else if ( defaultActive )
567 return QStringLiteral(
"(%1) NOT IN (%2) OR (%1) IS NULL" ).arg( attr, inactiveValues );
571 return QStringLiteral(
"(%1) IN (%2)" ).arg( attr, activeValues );
582 lst.append( cat.
symbol() );
589 QDomElement symbolsElem = element.firstChildElement( QStringLiteral(
"symbols" ) );
590 if ( symbolsElem.isNull() )
593 QDomElement catsElem = element.firstChildElement( QStringLiteral(
"categories" ) );
594 if ( catsElem.isNull() )
600 QDomElement catElem = catsElem.firstChildElement();
601 while ( !catElem.isNull() )
603 if ( catElem.tagName() == QLatin1String(
"category" ) )
605 QVariant value = QVariant( catElem.attribute( QStringLiteral(
"value" ) ) );
606 QString symbolName = catElem.attribute( QStringLiteral(
"symbol" ) );
607 QString label = catElem.attribute( QStringLiteral(
"label" ) );
608 bool render = catElem.attribute( QStringLiteral(
"render" ) ) != QLatin1String(
"false" );
609 if ( symbolMap.contains( symbolName ) )
611 QgsSymbol *symbol = symbolMap.take( symbolName );
615 catElem = catElem.nextSiblingElement();
618 QString attrName = element.attribute( QStringLiteral(
"attr" ) );
626 QDomElement sourceSymbolElem = element.firstChildElement( QStringLiteral(
"source-symbol" ) );
627 if ( !sourceSymbolElem.isNull() )
630 if ( sourceSymbolMap.contains( QStringLiteral(
"0" ) ) )
638 QDomElement sourceColorRampElem = element.firstChildElement( QStringLiteral(
"colorramp" ) );
639 if ( !sourceColorRampElem.isNull() && sourceColorRampElem.attribute( QStringLiteral(
"name" ) ) == QLatin1String(
"[source]" ) )
644 QDomElement rotationElem = element.firstChildElement( QStringLiteral(
"rotation" ) );
645 if ( !rotationElem.isNull() && !rotationElem.attribute( QStringLiteral(
"field" ) ).isEmpty() )
657 QDomElement sizeScaleElem = element.firstChildElement( QStringLiteral(
"sizescale" ) );
658 if ( !sizeScaleElem.isNull() && !sizeScaleElem.attribute( QStringLiteral(
"field" ) ).isEmpty() )
664 sizeScaleElem.attribute( QStringLiteral(
"field" ) ) );
670 sizeScaleElem.attribute( QStringLiteral(
"field" ) ) );
674 QDomElement ddsLegendSizeElem = element.firstChildElement( QStringLiteral(
"data-defined-size-legend" ) );
675 if ( !ddsLegendSizeElem.isNull() )
688 rendererElem.setAttribute( QStringLiteral(
"type" ), QStringLiteral(
"categorizedSymbol" ) );
689 rendererElem.setAttribute( QStringLiteral(
"symbollevels" ), (
mUsingSymbolLevels ? QStringLiteral(
"1" ) : QStringLiteral(
"0" ) ) );
690 rendererElem.setAttribute( QStringLiteral(
"forceraster" ), (
mForceRaster ? QStringLiteral(
"1" ) : QStringLiteral(
"0" ) ) );
691 rendererElem.setAttribute( QStringLiteral(
"attr" ),
mAttrName );
698 QDomElement catsElem = doc.createElement( QStringLiteral(
"categories" ) );
699 QgsCategoryList::const_iterator it =
mCategories.constBegin();
703 QString symbolName = QString::number( i );
704 symbols.insert( symbolName, cat.
symbol() );
706 QDomElement catElem = doc.createElement( QStringLiteral(
"category" ) );
707 catElem.setAttribute( QStringLiteral(
"value" ), cat.
value().toString() );
708 catElem.setAttribute( QStringLiteral(
"symbol" ), symbolName );
709 catElem.setAttribute( QStringLiteral(
"label" ), cat.
label() );
710 catElem.setAttribute( QStringLiteral(
"render" ), cat.
renderState() ?
"true" :
"false" );
711 catsElem.appendChild( catElem );
714 rendererElem.appendChild( catsElem );
718 rendererElem.appendChild( symbolsElem );
726 sourceSymbols.insert( QStringLiteral(
"0" ),
mSourceSymbol.get() );
728 rendererElem.appendChild( sourceSymbolElem );
735 rendererElem.appendChild( colorRampElem );
738 QDomElement rotationElem = doc.createElement( QStringLiteral(
"rotation" ) );
739 rendererElem.appendChild( rotationElem );
741 QDomElement sizeScaleElem = doc.createElement( QStringLiteral(
"sizescale" ) );
742 rendererElem.appendChild( sizeScaleElem );
749 QDomElement
orderBy = doc.createElement( QStringLiteral(
"orderby" ) );
751 rendererElem.appendChild( orderBy );
753 rendererElem.setAttribute( QStringLiteral(
"enableorderby" ), (
mOrderByEnabled ? QStringLiteral(
"1" ) : QStringLiteral(
"0" ) ) );
757 QDomElement ddsLegendElem = doc.createElement( QStringLiteral(
"data-defined-size-legend" ) );
759 rendererElem.appendChild( ddsLegendElem );
789 if ( sSize != ddSize )
792 return baseLegendSymbolItems();
809 lst += baseLegendSymbolItems();
814 return baseLegendSymbolItems();
819 QString value = valueForFeature( feature, context ).toString();
824 if ( value == cat.
value() )
827 return QSet< QString >() << QString::number( i );
829 return QSet< QString >();
834 return QSet< QString >();
872 double value = count / num;
899 int index = key.toInt( &ok );
900 if ( ok && index >= 0 && index <
mCategories.size() )
909 int index = key.toInt( &ok );
919 int index = key.toInt( &ok );
927 if ( renderer->
type() == QLatin1String(
"categorizedSymbol" ) )
931 else if ( renderer->
type() == QLatin1String(
"pointDisplacement" ) || renderer->
type() == QLatin1String(
"pointCluster" ) )
934 if ( pointDistanceRenderer )
937 else if ( renderer->
type() == QLatin1String(
"invertedPolygonRenderer" ) )
940 if ( invertedPolygonRenderer )
952 if ( !symbols.isEmpty() )
981 const QSet< QString > allSymbolNames = unmatchedSymbols.toSet();
983 const QRegularExpression tolerantMatchRe( QStringLiteral(
"[^\\w\\d ]" ), QRegularExpression::UseUnicodePropertiesOption );
985 for (
int catIdx = 0; catIdx <
mCategories.count(); ++catIdx )
987 const QVariant value =
mCategories.at( catIdx ).value();
988 const QString val = value.toString().trimmed();
989 std::unique_ptr< QgsSymbol > symbol( style->
symbol( val ) );
991 if ( symbol && symbol->type() ==
type )
994 unmatchedSymbols.removeAll( val );
999 if ( !caseSensitive || useTolerantMatch )
1001 QString testVal = val;
1002 if ( useTolerantMatch )
1003 testVal.replace( tolerantMatchRe, QString() );
1005 bool foundMatch =
false;
1006 for (
const QString &name : allSymbolNames )
1008 QString testName = name.trimmed();
1009 if ( useTolerantMatch )
1010 testName.replace( tolerantMatchRe, QString() );
1012 if ( testName == testVal || ( !caseSensitive && testName.trimmed().compare( testVal, Qt::CaseInsensitive ) == 0 ) )
1015 std::unique_ptr< QgsSymbol > symbol( style->
symbol( name ) );
1016 if ( symbol && symbol->type() ==
type )
1019 unmatchedSymbols.removeAll( name );
1030 unmatchedCategories << value;
An abstract base class for distance based point renderers (e.g., clusterer and displacement renderers...
Q_DECL_DEPRECATED QgsSymbol * skipRender()
Class for parsing and evaluation of expressions (formerly called "search strings").
void toSld(QDomDocument &doc, QDomElement &element, QgsStringMap props) const
Converts the category to a matching SLD rule, within the specified DOM document and element...
The class is used as a container of context for various read/write operations on other objects...
void CORE_EXPORT save(QDomElement &elem) const
Serialize to XML.
QgsSymbolList symbols(QgsRenderContext &context) const override
Returns list of symbols used by the renderer.
static QgsSymbol::ScaleMethod decodeScaleMethod(const QString &str)
bool hasParserError() const
Returns true if an error occurred when parsing the input expression.
QList< QgsLegendSymbolItem > QgsLegendSymbolList
QgsFeatureRequest::OrderBy mOrderBy
Represents an individual category (class) from a QgsCategorizedSymbolRenderer.
void updateColorRamp(QgsColorRamp *ramp)
Update the color ramp used and all symbols colors.
static bool createFunctionElement(QDomDocument &doc, QDomElement &element, const QString &function)
Abstract base class for all rendered symbols.
Q_DECL_DEPRECATED QgsSymbol * symbolForValue(const QVariant &value) const
Returns the matching symbol corresponding to an attribute value.
QString dump() const
Returns a string representing the categories settings, used for debugging purposes only...
bool updateCategoryRenderState(int catIndex, bool render)
Changes the render state for the category with the specified index.
static void applyScaleDependency(QDomDocument &doc, QDomElement &ruleElem, QgsStringMap &props)
Checks if the properties contain scaleMinDenom and scaleMaxDenom, if available, they are added into t...
static QgsFeatureRenderer * create(QDomElement &element, const QgsReadWriteContext &context)
Creates a categorized renderer from an XML element.
bool isActive() const
Returns whether the property is currently active.
double rendererScale() const
Returns the renderer map scale.
QSet< QString > referencedColumns() const
Gets list of columns referenced by the expression.
bool filterNeedsGeometry() const override
Returns true if this renderer requires the geometry to apply the filter.
QgsCategorizedSymbolRenderer(const QString &attrName=QString(), const QgsCategoryList &categories=QgsCategoryList())
Constructor for QgsCategorizedSymbolRenderer.
Abstract base class for color ramps.
bool usingSymbolLevels() const
void moveCategory(int from, int to)
Moves an existing category at index position from to index position to.
static bool isDefaultStack(QgsPaintEffect *effect)
Tests whether a paint effect matches the default effects stack.
static QDomElement saveColorRamp(const QString &name, QgsColorRamp *ramp, QDomDocument &doc)
Encodes a color ramp's settings to an XML element.
QString filter(const QgsFields &fields=QgsFields()) override
If a renderer does not require all the features this method may be overridden and return an expressio...
Container of fields for a vector layer.
#define RENDERER_TAG_NAME
void setUsingSymbolLevels(bool usingSymbolLevels)
void checkLegendSymbolItem(const QString &key, bool state=true) override
item in symbology was checked
bool updateCategoryLabel(int catIndex, const QString &label)
Changes the label for the category with the specified index.
static void clearSymbolMap(QgsSymbolMap &symbols)
QgsLegendSymbolList legendSymbolItems() const override
Returns a list of symbology items for the legend.
QgsPaintEffect * mPaintEffect
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
std::unique_ptr< QgsSymbol > mSourceSymbol
int categoryIndexForLabel(const QString &val)
Returns the index of the category with the specified label (or -1 if the label was not found...
bool qgsVariantGreaterThan(const QVariant &lhs, const QVariant &rhs)
Compares two QVariant values and returns whether the first is greater than the second.
void swap(QgsRendererCategory &other)
QgsField at(int i) const
Gets field at particular index (must be in range 0..N-1)
QMap< QString, QString > QgsStringMap
A marker symbol type, for rendering Point and MultiPoint geometries.
bool qgsVariantLessThan(const QVariant &lhs, const QVariant &rhs)
Compares two QVariant values and returns whether the first is less than the second.
bool valueGreaterThan(const QgsRendererCategory &c1, const QgsRendererCategory &c2)
void startRender(QgsRenderContext &context, const QgsFields &fields=QgsFields())
Begins the rendering process for the symbol.
QList< QgsRendererCategory > QgsCategoryList
SymbolType
Type of the symbol.
QgsCategorizedSymbolRenderer * clone() const override
Create a deep copy of this renderer.
QDomElement save(QDomDocument &doc, const QgsReadWriteContext &context) override
store renderer info to XML element
QList< QgsSymbol * > QgsSymbolList
QgsInvertedPolygonRenderer is a polygon-only feature renderer used to display features inverted...
#define QgsDebugMsgLevel(str, level)
QStringList symbolNames()
Returns a list of names of symbols.
static QDomElement saveSymbols(QgsSymbolMap &symbols, const QString &tagName, QDomDocument &doc, const QgsReadWriteContext &context)
Writes a collection of symbols to XML with specified tagName for the top-level element.
bool labelGreaterThan(const QgsRendererCategory &c1, const QgsRendererCategory &c2)
std::unique_ptr< QgsSymbol > mSymbol
QgsLegendSymbolList legendSymbolList() const
Generates legend symbol items according to the configuration.
bool needsGeometry() const
Returns true if the expression uses feature geometry for some computation.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
QgsCategoryList mCategories
QgsSymbol * originalSymbolForFeature(const QgsFeature &feature, QgsRenderContext &context) const override
Returns symbol for feature.
void sortByLabel(Qt::SortOrder order=Qt::AscendingOrder)
Sorts the existing categories by their label.
void startRender(QgsRenderContext &context, const QgsFields &fields) override
Must be called when a new render cycle is started.
void updateFromSymbolAndProperty(const QgsMarkerSymbol *symbol, const QgsProperty &ddSize)
Updates the list of classes, source symbol and title label from given symbol and property.
static QgsColorRamp * loadColorRamp(QDomElement &element)
Creates a color ramp from the settings encoded in an XML element.
static void convertSymbolSizeScale(QgsSymbol *symbol, QgsSymbol::ScaleMethod method, const QString &field)
bool legendSymbolItemChecked(const QString &key) override
items of symbology items in legend is checked
static QList< QgsExpressionContextScope * > globalProjectLayerScopes(const QgsMapLayer *layer)
Creates a list of three scopes: global, layer's project and layer.
void setLegendSymbolItem(const QString &key, QgsSymbol *symbol) override
Sets the symbol to be used for a legend symbol item.
int lookupField(const QString &fieldName) const
Looks up field's index from the field name.
QgsSymbol * sourceSymbol()
Returns the renderer's source symbol, which is the base symbol used for the each categories' symbol b...
A store for object properties.
void deleteAllCategories()
Deletes all existing categories from the renderer.
virtual void setTotalColorCount(int colorCount)
Sets the desired total number of unique colors for the resultant ramp.
static QgsSymbolMap loadSymbols(QDomElement &element, const QgsReadWriteContext &context)
Reads a collection of symbols from XML and returns them in a map. Caller is responsible for deleting ...
void stopRender(QgsRenderContext &context) override
Must be called when a render cycle has finished, to allow the renderer to clean up.
void setSymbol(QgsSymbol *s)
Sets the symbol which will be used to render this category.
bool labelLessThan(const QgsRendererCategory &c1, const QgsRendererCategory &c2)
bool orderByEnabled() const
Returns whether custom ordering will be applied before features are processed by this renderer...
void setRenderState(bool render)
Sets whether the category is currently enabled and should be rendered.
void setOrderBy(const QgsFeatureRequest::OrderBy &orderBy)
Define the order in which features shall be processed by this renderer.
Totally random color ramp.
int matchToSymbols(QgsStyle *style, QgsSymbol::SymbolType type, QVariantList &unmatchedCategories, QStringList &unmatchedSymbols, bool caseSensitive=true, bool useTolerantMatch=false)
Replaces category symbols with the symbols from a style that have a matching name and symbol type...
QString dump() const override
Returns debug information about this renderer.
QgsExpressionContext & expressionContext()
Gets the expression context.
void setDataDefinedSizeLegend(QgsDataDefinedSizeLegend *settings)
Configures appearance of legend when renderer is configured to use data-defined size for marker symbo...
bool legendSymbolItemsCheckable() const override
items of symbology items in legend should be checkable
static void convertSymbolRotation(QgsSymbol *symbol, const QString &field)
const QgsFeatureRenderer * embeddedRenderer() const override
Returns the current embedded renderer (subrenderer) for this feature renderer.
virtual bool saveProperties(QDomDocument &doc, QDomElement &element) const
Saves the current state of the effect to a DOM element.
void addCategory(const QgsRendererCategory &category)
Adds a new category to the renderer.
The class stores information about one class/rule of a vector layer renderer in a unified way that ca...
Contains information about the context of a rendering operation.
void setSourceColorRamp(QgsColorRamp *ramp)
Sets the source color ramp.
QgsProperty dataDefinedSize() const
Returns data defined size for whole symbol (including all symbol layers).
QgsColorRamp * sourceColorRamp()
Returns the source color ramp, from which each categories' color is derived.
QSet< QString > legendKeysForFeature(const QgsFeature &feature, QgsRenderContext &context) const override
Returns legend keys matching a specified feature.
QgsRendererCategory & operator=(QgsRendererCategory cat)
virtual void startRender(QgsRenderContext &context, const QgsFields &fields)
Must be called when a new render cycle is started.
bool prepare(const QgsExpressionContext *context)
Gets the expression ready for evaluation - find out column indexes.
virtual QgsSymbol * clone() const =0
Returns a deep copy of this symbol.
QgsSymbol * symbol() const
Returns the symbol which will be used to render this category.
QVariant value() const
Returns the value corresponding to this category.
std::unique_ptr< QgsColorRamp > mSourceColorRamp
void copyRendererData(QgsFeatureRenderer *destRenderer) const
Clones generic renderer data to another renderer.
int categoryIndexForValue(const QVariant &val)
Returns the index for the category with the specified value (or -1 if not found). ...
QString label() const
Returns the label for this category, which is used to represent the category within legends and the l...
bool updateCategoryValue(int catIndex, const QVariant &value)
Changes the value for the category with the specified index.
virtual void stopRender(QgsRenderContext &context)
Must be called when a render cycle has finished, to allow the renderer to clean up.
QMap< QString, QgsSymbol * > QgsSymbolMap
bool updateCategorySymbol(int catIndex, QgsSymbol *symbol)
Changes the symbol for the category with the specified index.
bool valueLessThan(const QgsRendererCategory &c1, const QgsRendererCategory &c2)
QgsSymbol * symbolForFeature(const QgsFeature &feature, QgsRenderContext &context) const override
To be overridden.
static QgsCategorizedSymbolRenderer * convertFromRenderer(const QgsFeatureRenderer *renderer)
creates a QgsCategorizedSymbolRenderer from an existing renderer.
QgsFeatureRequest::OrderBy orderBy() const
Gets the order in which features shall be processed by this renderer.
QHash< QString, QgsSymbol * > mSymbolHash
hashtable for faster access to symbols
void sortByValue(Qt::SortOrder order=Qt::AscendingOrder)
Sorts the existing categories by their value.
QgsSymbol * symbol(const QString &name)
Returns a NEW copy of symbol.
void updateSymbols(QgsSymbol *sym)
Update all the symbols but leave categories and colors.
void appendScopes(const QList< QgsExpressionContextScope * > &scopes)
Appends a list of scopes to the end of the context.
static QString quotedValue(const QVariant &value)
Returns a string representation of a literal value, including appropriate quotations where required...
const QgsFeatureRenderer * embeddedRenderer() const override
Returns the current embedded renderer (subrenderer) for this feature renderer.
QSet< QString > usedAttributes(const QgsRenderContext &context) const
Returns a list of attributes required to render this feature.
QgsRendererCategory()=default
Constructor for QgsRendererCategory.
QColor color() const
Returns the symbol's color.
Object that keeps configuration of appearance of marker symbol's data-defined size in legend...
std::unique_ptr< QgsExpression > mExpression
int mAttrNum
attribute index (derived from attribute name in startRender)
void toSld(QDomDocument &doc, QDomElement &element, const QgsStringMap &props=QgsStringMap()) const override
used from subclasses to create SLD Rule elements following SLD v1.1 specs
void setSourceSymbol(QgsSymbol *sym)
Sets the source symbol for the renderer, which is the base symbol used for the each categories' symbo...
void stopRender(QgsRenderContext &context)
Ends the rendering process.
void setLabel(const QString &label)
Sets the label for this category, which is used to represent the category within legends and the laye...
static QgsDataDefinedSizeLegend * readXml(const QDomElement &elem, const QgsReadWriteContext &context) SIP_FACTORY
Creates instance from given element and returns it (caller takes ownership). Returns null on error...
bool deleteCategory(int catIndex)
Deletes the category with the specified index from the renderer.
bool renderState() const
Returns true if the category is currently enabled and should be rendered.
QSet< QString > usedAttributes(const QgsRenderContext &context) const override
Returns a list of attributes required by this renderer.
void setOrderByEnabled(bool enabled)
Sets whether custom ordering should be applied before features are processed by this renderer...
void setValue(const QVariant &value)
Sets the value corresponding to this category.
virtual QgsFeatureRenderer * clone() const =0
Create a deep copy of this renderer.
QgsDataDefinedSizeLegend * dataDefinedSizeLegend() const
Returns configuration of appearance of legend when using data-defined size for marker symbols...
std::unique_ptr< QgsDataDefinedSizeLegend > mDataDefinedSizeLegend
void setColor(const QColor &color)
Sets the color for the symbol.