QgsFieldConditionalFormatWidget class

A widget for customizing conditional formatting options.

Constructors, destructors, conversion operators

QgsFieldConditionalFormatWidget(QWidget* parent = nullptr) explicit
Constructor for QgsFieldConditionalFormatWidget.

Public functions

auto defaultPresets() const -> QList<QgsConditionalStyle>
The default presets for the widget.
void editStyle(int index, const QgsConditionalStyle& style)
Switches the widget to the edit style mode for the specified style.
void loadStyle(const QgsConditionalStyle& style)
void reset()
Resets the formatting options to their default state.
void setLayer(QgsVectorLayer* layer)
Sets the vector layer associated with the widget.
void setPresets(const QList<QgsConditionalStyle>& styles)
Set the presets that can be used for quick pick.
void viewRules()
Switches the widget to the rules page.

Signals

void rulesUpdated(const QString& fieldName)
Emitted when the conditional styling rules are updated.

Function documentation

QgsFieldConditionalFormatWidget::QgsFieldConditionalFormatWidget(QWidget* parent = nullptr) explicit

Constructor for QgsFieldConditionalFormatWidget.

Parameters
parent parent widget

QList<QgsConditionalStyle> QgsFieldConditionalFormatWidget::defaultPresets() const

The default presets for the widget.

Returns List of default presets.

Normally set when the widget is created however called setPresets will override the default styles.

void QgsFieldConditionalFormatWidget::editStyle(int index, const QgsConditionalStyle& style)

Switches the widget to the edit style mode for the specified style.

Parameters
index index of conditional style to edit
style initial conditional styling options

void QgsFieldConditionalFormatWidget::loadStyle(const QgsConditionalStyle& style)

Parameters
style initial conditional styling options

void QgsFieldConditionalFormatWidget::setLayer(QgsVectorLayer* layer)

Sets the vector layer associated with the widget.

Parameters
layer vector layer

void QgsFieldConditionalFormatWidget::setPresets(const QList<QgsConditionalStyle>& styles)

Set the presets that can be used for quick pick.

Parameters
styles A list of styles used as presets

void QgsFieldConditionalFormatWidget::rulesUpdated(const QString& fieldName) signal

Emitted when the conditional styling rules are updated.

Parameters
fieldName name of field whose rules have been modified.