Class: QgsRasterBandComboBox¶
- class qgis.gui.QgsRasterBandComboBox¶
Bases:
PyQt5.QtWidgets.QComboBox
A combobox widget which displays the bands present in a raster layer.
QgsRasterBandComboBox(parent: QWidget = None) Constructor for QgsRasterBandComboBox.
Methods
Returns the current band number selected in the combobox, or -1 if no band is selected.
Returns a user-friendly band name for the specified
band
.Returns
True
if the combo box is showing the "not set" option.Returns the layer currently associated with the combobox.
Sets the current
band
number selected in the combobox.Sets the raster
layer
for which the bands are listed in the combobox.Sets whether the combo box should show the "not set" option.
Signals
pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL
- actionEvent(self, QActionEvent)¶
- bandChanged¶
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.
- Parameters:
name (str = ...) –
revision (int = ...) –
arguments (Sequence = ...) –
- Return type:
PYQT_SIGNAL
- changeEvent(self, QEvent)¶
- childEvent(self, QChildEvent)¶
- closeEvent(self, QCloseEvent)¶
- connectNotify(self, QMetaMethod)¶
- contextMenuEvent(self, QContextMenuEvent)¶
- create(self, window: PyQt5.sip.voidptr = 0, initializeWindow: bool = True, destroyOldWindow: bool = True)¶
- currentBand(self) int ¶
Returns the current band number selected in the combobox, or -1 if no band is selected.
See also
- Return type:
int
- customEvent(self, QEvent)¶
- destroy(self, destroyWindow: bool = True, destroySubWindows: bool = True)¶
- disconnectNotify(self, QMetaMethod)¶
- displayBandName(provider: QgsRasterDataProvider, band: int) str ¶
Returns a user-friendly band name for the specified
band
.- Parameters:
provider (QgsRasterDataProvider) –
band (int) –
- Return type:
str
- dragEnterEvent(self, QDragEnterEvent)¶
- dragLeaveEvent(self, QDragLeaveEvent)¶
- dragMoveEvent(self, QDragMoveEvent)¶
- dropEvent(self, QDropEvent)¶
- enterEvent(self, QEvent)¶
- focusInEvent(self, QFocusEvent)¶
- focusNextChild(self) bool ¶
- focusNextPrevChild(self, bool) bool ¶
- focusOutEvent(self, QFocusEvent)¶
- focusPreviousChild(self) bool ¶
- hideEvent(self, QHideEvent)¶
- initPainter(self, QPainter)¶
- initStyleOption(self, QStyleOptionComboBox)¶
- inputMethodEvent(self, QInputMethodEvent)¶
- isShowingNotSetOption(self) bool ¶
Returns
True
if the combo box is showing the “not set” option.See also
- Return type:
bool
- isSignalConnected(self, QMetaMethod) bool ¶
- keyPressEvent(self, QKeyEvent)¶
- keyReleaseEvent(self, QKeyEvent)¶
- layer(self) QgsRasterLayer ¶
Returns the layer currently associated with the combobox.
See also
- Return type:
- leaveEvent(self, QEvent)¶
- metric(self, QPaintDevice.PaintDeviceMetric) int ¶
- mouseDoubleClickEvent(self, QMouseEvent)¶
- mouseMoveEvent(self, QMouseEvent)¶
- mousePressEvent(self, QMouseEvent)¶
- mouseReleaseEvent(self, QMouseEvent)¶
- moveEvent(self, QMoveEvent)¶
- nativeEvent(self, Union[QByteArray, bytes, bytearray], PyQt5.sip.voidptr) Tuple[bool, int] ¶
- paintEvent(self, QPaintEvent)¶
- receivers(self, PYQT_SIGNAL) int ¶
- resizeEvent(self, QResizeEvent)¶
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setBand(self, band: int)¶
Sets the current
band
number selected in the combobox.See also
band()
- Parameters:
band (int) –
- setLayer(self, layer: QgsMapLayer)¶
Sets the raster
layer
for 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 (QgsMapLayer) –
- setShowNotSetOption(self, show: bool, string: str = '')¶
Sets whether the combo box should show the “not set” option. Optionally the built in “not set” text can be overridden by specifying a
string
.See also
- Parameters:
show (bool) –
string (str = '') –
- showEvent(self, QShowEvent)¶
- tabletEvent(self, QTabletEvent)¶
- timerEvent(self, QTimerEvent)¶
- updateMicroFocus(self)¶
- wheelEvent(self, QWheelEvent)¶