Class: QgsRasterHistogramWidget

A widget for display and configuring a raster layer histogram.

QgsRasterHistogramWidget

QgsRasterHistogramWidget

Class Hierarchy

Inheritance diagram of qgis.gui.QgsRasterHistogramWidget

Base classes

QgsMapLayerConfigWidget

A panel widget that can be shown in the map style dock.

QgsPanelWidget

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

QWidget

QObject

QPaintDevice

Methods

computeHistogram

Compute the histogram on demand.

histoAction

Apply a histoActionTriggered() event.

histoSaveAsImage

Save the histogram as an image to disk

refreshHistogram

slot executed when user wishes to refresh raster histogramwidget

setActive

Activate the histogram widget

setRendererWidget

Sets the renderer widget (or just its name if there is no widget)

setSelectedBand

Apply a histoActionTriggered() event.

class qgis.gui.QgsRasterHistogramWidget[source]

Bases: QgsMapLayerConfigWidget

__init__(layer: QgsRasterLayer | None, parent: QWidget | None = None)

Constructor for QgsRasterHistogramWidget, for the specified raster layer.

Parameters:
computeHistogram(self, forceComputeFlag: bool) bool[source]

Compute the histogram on demand.

Parameters:

forceComputeFlag (bool)

Return type:

bool

histoAction(self, actionName: str | None, actionFlag: bool = True)[source]

Apply a histoActionTriggered() event.

Parameters:
  • actionName (Optional[str])

  • actionFlag (bool = True)

histoSaveAsImage(self, filename: str | None, width: int = 600, height: int = 600, quality: int = -1) bool[source]

Save the histogram as an image to disk

Parameters:
  • filename (Optional[str])

  • width (int = 600)

  • height (int = 600)

  • quality (int = -1)

Return type:

bool

refreshHistogram(self)[source]

slot executed when user wishes to refresh raster histogramwidget

setActive(self, activeFlag: bool)[source]

Activate the histogram widget

Parameters:

activeFlag (bool)

setRendererWidget(self, name: str | None, rendererWidget: QgsRasterRendererWidget | None = None)[source]

Sets the renderer widget (or just its name if there is no widget)

Parameters:
setSelectedBand(self, index: int)[source]

Apply a histoActionTriggered() event.

Parameters:

index (int)