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 an inline panel.

QWidget

QObject

QPaintDevice

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[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.

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.