Class: QgsConditionalLayerStyles¶
- class qgis.core.QgsConditionalLayerStyles¶
Bases:
PyQt5.QtCore.QObject
The
QgsConditionalLayerStyles
class holds conditional style information for a layer. This includes field styles and full row styles.QgsConditionalLayerStyles(parent: QObject = None) Constructor for
QgsConditionalLayerStyles
, with the specifiedparent
object.Methods
Returns a style associated to a constraint failure.
Returns the conditional styles set for the field with matching
fieldName
.Reads the condition styles state from a DOM node.
Returns a list of row styles associated with the layer.
Returns
True
if at least one rule needs geometry.Set the conditional
styles
for a field, with the specifiedfieldName
.Sets the conditional
styles
that apply to full rows of data in the attribute table.Writes the condition styles state to a DOM node.
Signals
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
- changed¶
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.
- Parameters
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type
PYQT_SIGNAL
- childEvent(self, QChildEvent)¶
- connectNotify(self, QMetaMethod)¶
- constraintFailureStyles(self, strength: QgsFieldConstraints.ConstraintStrength) QgsConditionalStyle ¶
Returns a style associated to a constraint failure.
- Parameters
strength (QgsFieldConstraints.ConstraintStrength) – the type of constraint
New in version 3.30.
- Return type
- customEvent(self, QEvent)¶
- disconnectNotify(self, QMetaMethod)¶
- fieldStyles(self, fieldName: str) List[QgsConditionalStyle] ¶
Returns the conditional styles set for the field with matching
fieldName
.See also
- Parameters
fieldName (str) –
- Return type
List[QgsConditionalStyle]
- isSignalConnected(self, QMetaMethod) bool ¶
- readXml(self, node: QDomNode, context: QgsReadWriteContext) bool ¶
Reads the condition styles state from a DOM node.
See also
- Parameters
node (QDomNode) –
context (QgsReadWriteContext) –
- Return type
bool
- receivers(self, PYQT_SIGNAL) int ¶
- rowStyles(self) List[QgsConditionalStyle] ¶
Returns a list of row styles associated with the layer.
See also
- Return type
List[QgsConditionalStyle]
- rulesNeedGeometry(self) bool ¶
Returns
True
if at least one rule needs geometry.New in version 3.26.3.
- Return type
bool
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setFieldStyles(self, fieldName: str, styles: Iterable[QgsConditionalStyle])¶
Set the conditional
styles
for a field, with the specifiedfieldName
.The field value is inserted into a ‘value’ variable to conduct expression checks.
See also
- Parameters
fieldName (str) –
styles (Iterable[QgsConditionalStyle]) –
- setRowStyles(self, styles: Iterable[QgsConditionalStyle])¶
Sets the conditional
styles
that apply to full rows of data in the attribute table. Each row will check be checked against each rule.See also
New in version 2.12.
- Parameters
styles (Iterable[QgsConditionalStyle]) –
- timerEvent(self, QTimerEvent)¶
- writeXml(self, node: QDomNode, doc: QDomDocument, context: QgsReadWriteContext) bool ¶
Writes the condition styles state to a DOM node.
See also
- Parameters
node (QDomNode) –
doc (QDomDocument) –
context (QgsReadWriteContext) –
- Return type
bool