QgsColorSliderWidget class

A composite horizontal color ramp widget and associated spinbox for manual value entry.

Base classes

class QgsColorWidget
A base class for interactive color widgets.

Constructors, destructors, conversion operators

QgsColorSliderWidget(QWidget* parent = nullptr, ColorComponent component = QgsColorWidget::Red)
Construct a new color slider widget.

Public functions

void setColor(const QColor& color, bool emitSignals = false) override
Sets the color for the widget.
void setComponent(ColorComponent component) override
Sets the color component which the widget controls.
void setComponentValue(int value) override
Alters the widget's color by setting the value for the widget's color component.

Function documentation

QgsColorSliderWidget::QgsColorSliderWidget(QWidget* parent = nullptr, ColorComponent component = QgsColorWidget::Red)

Construct a new color slider widget.

Parameters
parent parent QWidget for the widget
component color component which is controlled by the slider

void QgsColorSliderWidget::setColor(const QColor& color, bool emitSignals = false) override

Sets the color for the widget.

Parameters
color widget color
emitSignals set to true to emit the colorChanged signal after setting color

void QgsColorSliderWidget::setComponent(ColorComponent component) override

Sets the color component which the widget controls.

Parameters
component color component for widget

void QgsColorSliderWidget::setComponentValue(int value) override

Alters the widget's color by setting the value for the widget's color component.

Parameters
value value for widget's color component. This value is automatically clipped to the range of valid values for the color component.