QgsSingleBandPseudoColorRendererWidget class

Single band pseudo color renderer widget consists of a color ramp shader widget, a raster min max widget and a band selector.

Public static functions

static auto create(QgsRasterLayer* layer, const QgsRectangle& extent) -> QgsRasterRendererWidget*
Creates new raster renderer widget.

Constructors, destructors, conversion operators

QgsSingleBandPseudoColorRendererWidget(QgsRasterLayer* layer, const QgsRectangle& extent = QgsRectangle())
Creates new raster renderer widget.

Public functions

auto currentBand() const -> int
Returns the current raster band number.
void doComputations() override
Load programmatically with current values.
auto minMaxWidget() -> QgsRasterMinMaxWidget* override
Returns min/max widget when it exists.
void setFromRenderer(const QgsRasterRenderer* r)
Set state of the widget from renderer settings.
void setMapCanvas(QgsMapCanvas* canvas) override
Sets the map canvas associated with the widget.

Public slots

void loadMinMax(int bandNo, double min, double max)
called when new min/max values are loaded
void loadMinMaxFromTree(double min, double max)
called when the color ramp tree has changed

Function documentation

void QgsSingleBandPseudoColorRendererWidget::setMapCanvas(QgsMapCanvas* canvas) override

Sets the map canvas associated with the widget.

Parameters
canvas map canvas

This allows the widget to retrieve the current map extent and other properties from the canvas.