15 #ifndef QGSCONDITIONALSTYLE_H 16 #define QGSCONDITIONALSTYLE_H 18 #include "qgis_core.h" 23 #include <QDomDocument> 43 QList<QgsConditionalStyle> rowStyles();
51 void setRowStyles(
const QList<QgsConditionalStyle> &styles );
58 void setFieldStyles(
const QString &fieldName,
const QList<QgsConditionalStyle> &styles );
64 QList<QgsConditionalStyle> fieldStyles(
const QString &fieldName );
74 bool writeXml( QDomNode &node, QDomDocument &doc,
const QgsReadWriteContext &context )
const;
77 QHash<QString, QgsConditionalStyles> mFieldStyles;
78 QList<QgsConditionalStyle> mRowStyles;
107 QPixmap renderPreview()
const;
113 void setName(
const QString &value ) { mName = value; mValid =
true; }
120 void setRule(
const QString &value ) { mRule = value; mValid =
true; }
132 void setTextColor(
const QColor &value ) { mTextColor = value; mValid =
true; }
138 void setFont(
const QFont &value ) { mFont = value; mValid =
true; }
150 QString displayText()
const;
156 QString
name()
const {
return mName; }
162 QPixmap
icon()
const {
return mIcon; }
181 bool validTextColor()
const;
194 bool validBackgroundColor()
const;
200 QFont
font()
const {
return mFont; }
207 QString
rule()
const {
return mRule; }
223 static QList<QgsConditionalStyle> matchingConditionalStyles(
const QList<QgsConditionalStyle> &styles,
const QVariant &value,
QgsExpressionContext &context );
250 bool writeXml( QDomNode &node, QDomDocument &doc,
const QgsReadWriteContext &context )
const;
258 std::unique_ptr<QgsSymbol> mSymbol;
265 #endif // QGSCONDITIONALSTYLE_H The class is used as a container of context for various read/write operations on other objects...
void setName(const QString &value)
Set the name of the style.
Abstract base class for all rendered symbols.
QColor textColor() const
The text color set for style.
void setRule(const QString &value)
Set the rule for the style.
QFont font() const
The font for the style.
QPixmap icon() const
The icon set for style generated from the set symbol.
Conditional styling for a rule.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
QColor backgroundColor() const
The background color for style.
QString name() const
The name of 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.
The QgsConditionalLayerStyles class holds conditional style information for a layer.
QString rule() const
The condition rule set for the style.
bool isValid() const
isValid Check if this rule is valid.
QgsSymbol * symbol() const
The symbol used to generate the icon for the style.
QList< QgsConditionalStyle > QgsConditionalStyles
void setTextColor(const QColor &value)
Set the text color for the style.