QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
|
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 24 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 29 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 79 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 128 of file qgsconditionalstyle.cpp.
QgsConditionalStyles QgsConditionalLayerStyles::rowStyles | ( | ) | const |
Returns a list of row styles associated with the layer.
Definition at line 56 of file qgsconditionalstyle.cpp.
bool QgsConditionalLayerStyles::rulesNeedGeometry | ( | ) | const |
Returns true
if at least one rule needs geometry.
Definition at line 116 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 70 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 61 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 84 of file qgsconditionalstyle.cpp.