Class: QgsFieldConditionalFormatWidget¶
A widget for customizing conditional formatting options.
Class Hierarchy¶
Base classes¶
Base class for any widget that can be shown as a inline panel |
|
Methods
Switches the widget to the edit style mode for the specified style, where index is the index of the conditional style to edit and style is the initial definition of the style. |
|
Resets the formatting options to their default state. |
|
Sets the vector layer associated with the widget. |
|
Sets the preset styles that can be used for quick pick. |
|
Switches the widget to the rules page. |
Static Methods
Returns a list of the default presets. |
Signals
Emitted when the conditional styling rules are updated. |
- class qgis.gui.QgsFieldConditionalFormatWidget[source]¶
Bases:
QgsPanelWidget
- __init__(parent: QWidget | None = None)
Constructor for QgsFieldConditionalFormatWidget.
- Parameters:
parent (Optional[QWidget] = None)
- static defaultPresets() List[QgsConditionalStyle] ¶
Returns a list of the default presets. Normally used when the widget is created, however calling
setPresets()
will override the default styles.- Return type:
List[QgsConditionalStyle]
- editStyle(self, index: int, style: QgsConditionalStyle)[source]¶
Switches the widget to the edit style mode for the specified style, where
index
is the index of the conditional style to edit andstyle
is the initial definition of the style.- Parameters:
index (int)
style (QgsConditionalStyle)
- loadStyle(self, style: QgsConditionalStyle)[source]¶
Deprecated since version 3.40.
No longer used, use
QgsEditConditionalFormatRuleWidget
.loadStyle instead.- Parameters:
style (QgsConditionalStyle)
- reset(self)[source]¶
Resets the formatting options to their default state.
Deprecated since version 3.40: No longer used, will be removed in QGIS 4.0.
- signal rulesUpdated(fieldName: str)[source]¶
Emitted when the conditional styling rules are updated.
The
fieldName
argument indicates the name of the field whose rules have been modified, or an emptyfieldName
indicates that a row-based rule was updated.- Parameters:
fieldName (str)
- setLayer(self, layer: QgsVectorLayer | None)[source]¶
Sets the vector
layer
associated with the widget.- Parameters:
layer (Optional[QgsVectorLayer])
- setPresets(self, styles: Iterable[QgsConditionalStyle])[source]¶
Sets the preset
styles
that can be used for quick pick.- Parameters:
styles (Iterable[QgsConditionalStyle])