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
Returns the conditional styles set for the field UI properties
Reads field ui properties specific state from Dom node.
- rtype
List[QgsConditionalStyle]
Set the conditional styles for the field UI properties.
Set the conditional styles that apply to full rows of data in the attribute table.
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
node (QDomNode) –
context (QgsReadWriteContext) –
- 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
fieldName (str) – name of field
styles (Iterable[QgsConditionalStyle]) –
-
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
node (QDomNode) –
doc (QDomDocument) –
context (QgsReadWriteContext) –
- Return type
bool