Class: QgsRasterMinMaxWidget

QgsRasterMinMaxWidget

QgsRasterMinMaxWidget

Class Hierarchy

Inheritance diagram of qgis.gui.QgsRasterMinMaxWidget

Base classes

QWidget

QObject

QPaintDevice

Methods

doComputations

Load programmatically with current values

extent

Returns the extent selected by the user.

hideUpdatedExtent

Hide updated extent choice

isCollapsed

Returns if the widget is collaped.

mapCanvas

Returns the map canvas associated with the widget.

minMaxOrigin

Returns a QgsRasterMinMaxOrigin object with the widget values.

sampleSize

Returns the selected sample size.

setBands

setCollapsed

Sets collapsed state of widget

setExtent

Sets the extent to use for minimum and maximum value calculation.

setFromMinMaxOrigin

Sets the "source" of min/max values.

setMapCanvas

Sets the map canvas associated with the widget.

userHasSetManualMinMaxValues

Uncheck cumulative cut, min/max, std-dev radio buttons

Signals

load

signal emitted when new min/max values are computed from statistics.

widgetChanged

Emitted when something on the widget has changed.

class qgis.gui.QgsRasterMinMaxWidget(layer: QgsRasterLayer | None, parent: QWidget | None = None)[source]

Bases: QWidget

doComputations(self)[source]

Load programmatically with current values

extent(self) QgsRectangle[source]

Returns the extent selected by the user. Either an empty extent for ‘full’ or the current visible extent.

Return type:

QgsRectangle

hideUpdatedExtent(self)[source]

Hide updated extent choice

isCollapsed(self) bool[source]

Returns if the widget is collaped.

Return type:

bool

signal load(bandNo: int, min: float, max: float)[source]

signal emitted when new min/max values are computed from statistics.

Parameters:
  • bandNo (int)

  • min (float)

  • max (float)

mapCanvas(self) QgsMapCanvas | None[source]

Returns the map canvas associated with the widget.

See also

setMapCanvas()

Return type:

Optional[QgsMapCanvas]

minMaxOrigin(self) QgsRasterMinMaxOrigin[source]

Returns a QgsRasterMinMaxOrigin object with the widget values.

Return type:

QgsRasterMinMaxOrigin

sampleSize(self) int[source]

Returns the selected sample size.

Return type:

int

setBands(self, bands: Iterable[int])[source]
Parameters:

bands (Iterable[int])

setCollapsed(self, b: bool)[source]

Sets collapsed state of widget

Parameters:

b (bool)

setExtent(self, extent: QgsRectangle)[source]

Sets the extent to use for minimum and maximum value calculation.

Parameters:

extent (QgsRectangle) – extent in raster layer’s CRS

Note

if a map canvas is set using setMapCanvas(), its extent will take precedence over any extent set using this method.

setFromMinMaxOrigin(self, a0: QgsRasterMinMaxOrigin)[source]

Sets the “source” of min/max values.

Parameters:

a0 (QgsRasterMinMaxOrigin)

setMapCanvas(self, canvas: QgsMapCanvas | None)[source]

Sets the map canvas associated with the widget. This allows the widget to retrieve the current map extent from the canvas. If a canvas is set it will take precedence over any extent set from calling setExtent().

Parameters:

canvas (Optional[QgsMapCanvas]) – map canvas

See also

mapCanvas()

userHasSetManualMinMaxValues(self)[source]

Uncheck cumulative cut, min/max, std-dev radio buttons

signal widgetChanged[source]

Emitted when something on the widget has changed. All widgets will fire this event to notify of an internal change.