Class: QgsConditionalLayerStyles¶
Holds conditional style information for a layer.
This includes field styles and full row styles.
Class Hierarchy¶
Base classes¶
- class qgis.core.QgsConditionalLayerStyles[source]¶
Bases:
QObject- __init__(parent: QObject | None = None)
Constructor for QgsConditionalLayerStyles, with the specified
parentobject.- Parameters:
parent (Optional[QObject] = None)
- signal changed[source]¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- constraintFailureStyles(self, strength: QgsFieldConstraints.ConstraintStrength) QgsConditionalStyle[source]¶
Returns a style associated to a constraint failure.
- Parameters:
strength (QgsFieldConstraints.ConstraintStrength) – the type of constraint
Added in version 3.30.
- Return type:
- fieldStyles(self, fieldName: str | None) List[QgsConditionalStyle]¶
Returns the conditional styles set for the field with matching
fieldName.See also
- Parameters:
fieldName (Optional[str])
- Return type:
- readXml(self, node: QDomNode, context: QgsReadWriteContext) bool[source]¶
Reads the condition styles state from a DOM node.
See also
- Parameters:
node (QDomNode)
context (QgsReadWriteContext)
- Return type:
bool
- rowStyles(self) List[QgsConditionalStyle][source]¶
Returns a list of row styles associated with the layer.
See also
- Return type:
- rulesNeedGeometry(self) bool[source]¶
Returns
Trueif at least one rule needs geometry.Added in version 3.26.3.
- Return type:
bool
- setFieldStyles(self, fieldName: str | None, styles: Iterable[QgsConditionalStyle])[source]¶
Set the conditional
stylesfor a field, with the specifiedfieldName.The field value is inserted into a ‘value’ variable to conduct expression checks.
See also
- Parameters:
fieldName (Optional[str])
styles (Iterable[QgsConditionalStyle])
- setRowStyles(self, styles: Iterable[QgsConditionalStyle])[source]¶
Sets the conditional
stylesthat apply to full rows of data in the attribute table. Each row will check be checked against each rule.See also
- Parameters:
styles (Iterable[QgsConditionalStyle])
- writeXml(self, node: QDomNode, doc: QDomDocument, context: QgsReadWriteContext) bool[source]¶
Writes the condition styles state to a DOM node.
See also
- Parameters:
node (QDomNode)
doc (QDomDocument)
context (QgsReadWriteContext)
- Return type:
bool