Class: QgsRasterRendererWidget¶
Abstract base class for widgets which configure a
QgsRasterRenderer
.
Note
This is an abstract class, with methods which must be implemented by a subclass.
The following methods must be implemented: renderer()
Class Hierarchy¶
Base classes¶
Subclasses¶
Renderer widget for the hill shade renderer. |
|
A widget for configuring a |
|
A widget for configuring |
|
Configuration widget for |
|
A widget for configuring a |
|
Single band pseudo color renderer widget consists of a color ramp shader widget, a raster min max widget and a band selector. |
Abstract Methods
Creates a new renderer, using the properties defined in the widget. |
Methods
Returns the map canvas associated with the widget. |
|
Returns the raster layer associated with the widget. |
|
Sets the raster layer associated with the widget. |
Virtual Methods
In PyQGIS, only methods marked as virtual
can be safely overridden in a Python subclass of QgsRasterRendererWidget. See the FAQ for more details.
Returns the contrast enhancement algorithm to be used by the raster renderer. |
|
Load programmatically with current values |
|
Returns min/max widget when it exists. |
|
Sets the contrast enhancement algorithm to be used by the raster renderer. |
|
Sets the map canvas associated with the widget. |
|
Signals
Emitted when something on the widget has changed. |
- class qgis.gui.QgsRasterRendererWidget[source]¶
Bases:
QWidget
- __init__(layer: QgsRasterLayer | None, extent: QgsRectangle)
Constructor for QgsRasterRendererWidget.
- Parameters:
layer (Optional[QgsRasterLayer]) – associated raster layer
extent (QgsRectangle) – current canvas extent
- virtual contrastEnhancementAlgorithm(self) QgsContrastEnhancement.ContrastEnhancementAlgorithm [source]¶
Returns the contrast enhancement
algorithm
to be used by the raster renderer.Added in version 3.26.
- Return type:
- mapCanvas(self) QgsMapCanvas | None [source]¶
Returns the map canvas associated with the widget.
See also
- Return type:
Optional[QgsMapCanvas]
- virtual minMaxWidget(self) QgsRasterMinMaxWidget | None [source]¶
Returns min/max widget when it exists.
- Return type:
Optional[QgsRasterMinMaxWidget]
- rasterLayer(self) QgsRasterLayer | None [source]¶
Returns the raster layer associated with the widget.
See also
- Return type:
Optional[QgsRasterLayer]
- abstract renderer(self) QgsRasterRenderer | None [source]¶
Creates a new renderer, using the properties defined in the widget.
The caller takes ownership of the returned renderer.
- Return type:
Optional[QgsRasterRenderer]
- virtual selectedBand(self, index: int = 0) int [source]¶
- Parameters:
index (int = 0)
- Return type:
int
- virtual setContrastEnhancementAlgorithm(self, algorithm: QgsContrastEnhancement.ContrastEnhancementAlgorithm)[source]¶
Sets the contrast enhancement
algorithm
to be used by the raster renderer.Added in version 3.26.
- Parameters:
algorithm (QgsContrastEnhancement.ContrastEnhancementAlgorithm)
- virtual setMapCanvas(self, canvas: QgsMapCanvas | None)[source]¶
Sets the map canvas associated with the widget. This allows the widget to retrieve the current map extent and other properties from the canvas.
- Parameters:
canvas (Optional[QgsMapCanvas]) – map canvas
See also
- virtual setMax(self, value: str | None, index: int = 0)[source]¶
- Parameters:
value (Optional[str])
index (int = 0)
- virtual setMin(self, value: str | None, index: int = 0)[source]¶
- Parameters:
value (Optional[str])
index (int = 0)
- setRasterLayer(self, layer: QgsRasterLayer | None)[source]¶
Sets the raster
layer
associated with the widget.See also
- Parameters:
layer (Optional[QgsRasterLayer])