Class: QgsFieldConditionalFormatWidget

A widget for customizing conditional formatting options.

Class Hierarchy

Inheritance diagram of qgis.gui.QgsFieldConditionalFormatWidget

Base classes

QgsPanelWidget

Base class for any widget that can be shown as a inline panel

QWidget

QObject

QPaintDevice

Methods

editStyle

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.

loadStyle

reset

Resets the formatting options to their default state.

setLayer

Sets the vector layer associated with the widget.

setPresets

Sets the preset styles that can be used for quick pick.

viewRules

Switches the widget to the rules page.

Static Methods

defaultPresets

Returns a list of the default presets.

Signals

rulesUpdated

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 and style is the initial definition of the style.

Parameters:
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 empty fieldName 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])

viewRules(self)[source]

Switches the widget to the rules page.

Deprecated since version 3.40: No longer used, will be removed in QGIS 4.0.