Class: QgsRasterBandComboBox¶
A combobox widget which displays the bands present in a raster layer.
QgsRasterBandComboBox in the collapsed state¶
QgsRasterBandComboBox in the expanded state¶
Class Hierarchy¶
Base classes¶
- class qgis.gui.QgsRasterBandComboBox[source]¶
Bases:
QComboBox- __init__(parent: QWidget | None = None)
Constructor for QgsRasterBandComboBox.
- Parameters:
parent (Optional[QWidget] = None)
- signal bandChanged[source]¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- currentBand(self) int[source]¶
Returns the current band number selected in the combobox, or -1 if no band is selected.
See also
- Return type:
int
- static displayBandName(provider: QgsRasterDataProvider | None, band: int) str[source]¶
Returns a user-friendly band name for the specified
band.- Parameters:
provider (Optional[QgsRasterDataProvider])
band (int)
- Return type:
str
- isShowingNotSetOption(self) bool[source]¶
Returns
Trueif the combo box is showing the “not set” option.See also
- Return type:
bool
- layer(self) QgsRasterLayer | None[source]¶
Returns the layer currently associated with the combobox.
See also
- Return type:
Optional[QgsRasterLayer]
- setBand(self, band: int)[source]¶
Sets the current
bandnumber selected in the combobox.See also
band()- Parameters:
band (int)
- setLayer(self, layer: QgsMapLayer | None)[source]¶
Sets the raster
layerfor which the bands are listed in the combobox. If no layer is set or a non-raster layer is set then the combobox will be empty.See also
- Parameters:
layer (Optional[QgsMapLayer])