QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
Public Slots | Signals | Public Member Functions | Static Public Member Functions | Properties | List of all members
QgsRasterBandComboBox Class Reference

A combobox widget which displays the bands present in a raster layer. More...

#include <qgsrasterbandcombobox.h>

Inheritance diagram for QgsRasterBandComboBox:
Inheritance graph
[legend]

Public Slots

void setBand (int band)
 Sets the current band number selected in the combobox. More...
 
void setLayer (QgsMapLayer *layer)
 Sets the raster layer for which the bands are listed in the combobox. More...
 

Signals

void bandChanged (int band)
 Emitted when the currently selected band changes. More...
 

Public Member Functions

 QgsRasterBandComboBox (QWidget *parent=nullptr)
 Constructor for QgsRasterBandComboBox. More...
 
int currentBand () const
 Returns the current band number selected in the combobox, or -1 if no band is selected. More...
 
bool isShowingNotSetOption () const
 Returns true if the combo box is showing the "not set" option. More...
 
QgsRasterLayerlayer () const
 Returns the layer currently associated with the combobox. More...
 
void setShowNotSetOption (bool show, const QString &string=QString())
 Sets whether the combo box should show the "not set" option. More...
 

Static Public Member Functions

static QString displayBandName (QgsRasterDataProvider *provider, int band)
 Returns a user-friendly band name for the specified band. More...
 

Properties

int band
 

Detailed Description

A combobox widget which displays the bands present in a raster layer.

Definition at line 33 of file qgsrasterbandcombobox.h.

Constructor & Destructor Documentation

◆ QgsRasterBandComboBox()

QgsRasterBandComboBox::QgsRasterBandComboBox ( QWidget *  parent = nullptr)

Constructor for QgsRasterBandComboBox.

Definition at line 20 of file qgsrasterbandcombobox.cpp.

Member Function Documentation

◆ bandChanged

void QgsRasterBandComboBox::bandChanged ( int  band)
signal

Emitted when the currently selected band changes.

◆ currentBand()

int QgsRasterBandComboBox::currentBand ( ) const

Returns the current band number selected in the combobox, or -1 if no band is selected.

See also
setBand()

Definition at line 65 of file qgsrasterbandcombobox.cpp.

◆ displayBandName()

QString QgsRasterBandComboBox::displayBandName ( QgsRasterDataProvider provider,
int  band 
)
static

Returns a user-friendly band name for the specified band.

Definition at line 164 of file qgsrasterbandcombobox.cpp.

◆ isShowingNotSetOption()

bool QgsRasterBandComboBox::isShowingNotSetOption ( ) const

Returns true if the combo box is showing the "not set" option.

See also
setShowNotSetOption()

Definition at line 152 of file qgsrasterbandcombobox.cpp.

◆ layer()

QgsRasterLayer * QgsRasterBandComboBox::layer ( ) const

Returns the layer currently associated with the combobox.

See also
setLayer()

Definition at line 60 of file qgsrasterbandcombobox.cpp.

◆ setBand

void QgsRasterBandComboBox::setBand ( int  band)
slot

Sets the current band number selected in the combobox.

See also
band()

Definition at line 132 of file qgsrasterbandcombobox.cpp.

◆ setLayer

void QgsRasterBandComboBox::setLayer ( QgsMapLayer layer)
slot

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
layer()

Definition at line 84 of file qgsrasterbandcombobox.cpp.

◆ setShowNotSetOption()

void QgsRasterBandComboBox::setShowNotSetOption ( bool  show,
const QString &  string = QString() 
)

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
setShowNotSetOption()

Definition at line 157 of file qgsrasterbandcombobox.cpp.

Property Documentation

◆ band

int QgsRasterBandComboBox::band
readwrite

Definition at line 33 of file qgsrasterbandcombobox.h.


The documentation for this class was generated from the following files: