QGIS API Documentation 3.41.0-Master (45a0abf3bec)
|
The QgsConditionalLayerStyles class holds conditional style information for a layer. More...
#include <qgsconditionalstyle.h>
Signals | |
void | changed () |
Emitted when the conditional styles are changed. | |
Public Member Functions | |
QgsConditionalLayerStyles (QObject *parent=nullptr) | |
Constructor for QgsConditionalLayerStyles, with the specified parent object. | |
QgsConditionalStyle | constraintFailureStyles (QgsFieldConstraints::ConstraintStrength strength) |
Returns a style associated to a constraint failure. | |
QList< QgsConditionalStyle > | fieldStyles (const QString &fieldName) const |
Returns the conditional styles set for the field with matching fieldName. | |
bool | readXml (const QDomNode &node, const QgsReadWriteContext &context) |
Reads the condition styles state from a DOM node. | |
QgsConditionalStyles | rowStyles () const |
Returns a list of row styles associated with the layer. | |
bool | rulesNeedGeometry () const |
Returns true if at least one rule needs geometry. | |
void | setFieldStyles (const QString &fieldName, const QList< QgsConditionalStyle > &styles) |
Set the conditional styles for a field, with the specified fieldName. | |
void | setRowStyles (const QgsConditionalStyles &styles) |
Sets the conditional styles that apply to full rows of data in the attribute table. | |
bool | writeXml (QDomNode &node, QDomDocument &doc, const QgsReadWriteContext &context) const |
Writes the condition styles state to a DOM node. | |
The QgsConditionalLayerStyles class holds conditional style information for a layer.
This includes field styles and full row styles.
Definition at line 42 of file qgsconditionalstyle.h.
QgsConditionalLayerStyles::QgsConditionalLayerStyles | ( | QObject * | parent = nullptr | ) |
Constructor for QgsConditionalLayerStyles, with the specified parent object.
Definition at line 25 of file qgsconditionalstyle.cpp.
|
signal |
Emitted when the conditional styles are changed.
QgsConditionalStyle QgsConditionalLayerStyles::constraintFailureStyles | ( | QgsFieldConstraints::ConstraintStrength | strength | ) |
Returns a style associated to a constraint failure.
strength | the type of constraint |
Definition at line 30 of file qgsconditionalstyle.cpp.
QList< QgsConditionalStyle > QgsConditionalLayerStyles::fieldStyles | ( | const QString & | fieldName | ) | const |
Returns the conditional styles set for the field with matching fieldName.
Definition at line 80 of file qgsconditionalstyle.cpp.
bool QgsConditionalLayerStyles::readXml | ( | const QDomNode & | node, |
const QgsReadWriteContext & | context | ||
) |
Reads the condition styles state from a DOM node.
Definition at line 129 of file qgsconditionalstyle.cpp.
QgsConditionalStyles QgsConditionalLayerStyles::rowStyles | ( | ) | const |
Returns a list of row styles associated with the layer.
Definition at line 57 of file qgsconditionalstyle.cpp.
bool QgsConditionalLayerStyles::rulesNeedGeometry | ( | ) | const |
Returns true
if at least one rule needs geometry.
Definition at line 117 of file qgsconditionalstyle.cpp.
void QgsConditionalLayerStyles::setFieldStyles | ( | const QString & | fieldName, |
const QList< QgsConditionalStyle > & | styles | ||
) |
Set the conditional styles for a field, with the specified fieldName.
The field value is inserted into a 'value' variable to conduct expression checks.
Definition at line 71 of file qgsconditionalstyle.cpp.
void QgsConditionalLayerStyles::setRowStyles | ( | const QgsConditionalStyles & | styles | ) |
Sets the conditional styles that apply to full rows of data in the attribute table.
Each row will check be checked against each rule.
Definition at line 62 of file qgsconditionalstyle.cpp.
bool QgsConditionalLayerStyles::writeXml | ( | QDomNode & | node, |
QDomDocument & | doc, | ||
const QgsReadWriteContext & | context | ||
) | const |
Writes the condition styles state to a DOM node.
Definition at line 85 of file qgsconditionalstyle.cpp.