QgsConditionalLayerStyles class

The QgsConditionalLayerStyles class holds conditional style information for a layer.

Contents

This includes field styles and full row styles.

Public functions

auto fieldStyles(const QString& fieldName) -> QList<QgsConditionalStyle>
Returns the conditional styles set for the field UI properties.
auto readXml(const QDomNode& node, const QgsReadWriteContext& context) -> bool
Reads field ui properties specific state from Dom node.
void setFieldStyles(const QString& fieldName, const QList<QgsConditionalStyle>& styles)
Set the conditional styles for the field UI properties.
void setRowStyles(const QList<QgsConditionalStyle>& styles)
Set the conditional styles that apply to full rows of data in the attribute table.
auto writeXml(QDomNode& node, QDomDocument& doc, const QgsReadWriteContext& context) const -> bool
Write field ui properties specific state from Dom node.

Function documentation

QList<QgsConditionalStyle> QgsConditionalLayerStyles::fieldStyles(const QString& fieldName)

Returns the conditional styles set for the field UI properties.

Returns A list of conditional styles that have been set.

void QgsConditionalLayerStyles::setFieldStyles(const QString& fieldName, const QList<QgsConditionalStyle>& styles)

Set the conditional styles for the field UI properties.

Parameters
fieldName name of field
styles

void QgsConditionalLayerStyles::setRowStyles(const QList<QgsConditionalStyle>& styles)

Set the conditional styles that apply to full rows of data in the attribute table.

Parameters
styles The styles to assign to all the rows

Each row will check be checked against each rule.