Class: QgsConditionalLayerStyles

class qgis.core.QgsConditionalLayerStyles

Bases: sip.wrapper

The QgsConditionalLayerStyles class holds conditional style information for a layer. This includes field styles and full row styles.

Methods

fieldStyles

Returns the conditional styles set for the field UI properties

readXml

Reads field ui properties specific state from Dom node.

rowStyles

rtype

List[QgsConditionalStyle]

setFieldStyles

Set the conditional styles for the field UI properties.

setRowStyles

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

writeXml

Write field ui properties specific state from Dom node.

fieldStyles(self, fieldName: str) → List[QgsConditionalStyle]

Returns the conditional styles set for the field UI properties

Return type

List[QgsConditionalStyle]

Returns

A list of conditional styles that have been set.

Parameters

fieldName (str) –

readXml(self, node: QDomNode, context: QgsReadWriteContext) → bool

Reads field ui properties specific state from Dom node.

Parameters
Return type

bool

rowStyles(self) → List[QgsConditionalStyle]
Return type

List[QgsConditionalStyle]

setFieldStyles(self, fieldName: str, styles: Iterable[QgsConditionalStyle])

Set the conditional styles for the field UI properties.

Parameters
setRowStyles(self, styles: Iterable[QgsConditionalStyle])

Set the conditional styles that apply to full rows of data in the attribute table. Each row will check be checked against each rule.

Parameters

styles (Iterable[QgsConditionalStyle]) – The styles to assign to all the rows

New in version 2.12.

writeXml(self, node: QDomNode, doc: QDomDocument, context: QgsReadWriteContext) → bool

Write field ui properties specific state from Dom node.

Parameters
Return type

bool