15#ifndef QGSCONDITIONALSTYLE_H
16#define QGSCONDITIONALSTYLE_H
26#include <QDomDocument>
83 void setFieldStyles(
const QString &fieldName,
const QList<QgsConditionalStyle> &styles );
90 QList<QgsConditionalStyle> fieldStyles(
const QString &fieldName )
const;
104 bool writeXml( QDomNode &node, QDomDocument &doc,
const QgsReadWriteContext &context )
const;
110 bool rulesNeedGeometry()
const;
122 QHash<QString, QgsConditionalStyles> mFieldStyles;
156 QPixmap renderPreview(
const QSize &size = QSize() )
const;
162 void setName(
const QString &value ) { mName = value; mValid =
true; }
169 void setRule(
const QString &value ) { mRule = value; mValid =
true; }
181 void setTextColor(
const QColor &value ) { mTextColor = value; mValid =
true; }
187 void setFont(
const QFont &value ) { mFont = value; mValid =
true; }
199 QString displayText()
const;
205 QString
name()
const {
return mName; }
211 QPixmap
icon()
const {
return mIcon; }
230 bool validTextColor()
const;
243 bool validBackgroundColor()
const;
249 QFont
font()
const {
return mFont; }
256 QString
rule()
const {
return mRule; }
272 static QList<QgsConditionalStyle> matchingConditionalStyles(
const QList<QgsConditionalStyle> &styles,
const QVariant &value,
QgsExpressionContext &context );
299 bool writeXml( QDomNode &node, QDomDocument &doc,
const QgsReadWriteContext &context )
const;
305 SIP_PYOBJECT __repr__();
308 if ( !sipCpp->name().isEmpty() )
309 str = QStringLiteral(
"<QgsConditionalStyle: '%1' (%2)>" ).arg( sipCpp->name(), sipCpp->rule() );
311 str = QStringLiteral(
"<QgsConditionalStyle: %2>" ).arg( sipCpp->rule() );
312 sipRes = PyUnicode_FromString(
str.toUtf8().constData() );
321 std::unique_ptr<QgsSymbol> mSymbol;
The QgsConditionalLayerStyles class holds conditional style information for a layer.
void changed()
Emitted when the conditional styles are changed.
Conditional styling for a rule.
QString name() const
The name of the style.
void setName(const QString &value)
Set the name of the style.
void setTextColor(const QColor &value)
Set the text color for the style.
void setRule(const QString &value)
Set the rule for the style.
void setBackgroundColor(const QColor &value)
Set the background color for the style.
void setFont(const QFont &value)
Set the font for the style.
QColor backgroundColor() const
The background color for style.
QColor textColor() const
The text color set for style.
QString rule() const
The condition rule set for the style.
QFont font() const
The font for the style.
QgsSymbol * symbol() const
The symbol used to generate the icon for the style.
bool isValid() const
isValid Check if this rule is valid.
QPixmap icon() const
The icon set for style generated from the set symbol.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
ConstraintStrength
Strength of constraints.
The class is used as a container of context for various read/write operations on other objects.
Abstract base class for all rendered symbols.
QList< QgsConditionalStyle > QgsConditionalStyles
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)