QGIS API Documentation 3.41.0-Master (af5edcb665c)
Loading...
Searching...
No Matches
qgsrasterbandcombobox.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsrasterbandcombobox.h
3 -----------------------
4 begin : May 2017
5 copyright : (C) 2017 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSRASTERBANDCOMBOBOX_H
17#define QGSRASTERBANDCOMBOBOX_H
18
19#include "qgis_gui.h"
20#include "qgis_sip.h"
21#include "qgsrasterlayer.h"
22#include <QComboBox>
23#include <QPointer>
24
25class QgsMapLayer;
27
33class GUI_EXPORT QgsRasterBandComboBox : public QComboBox
34{
35 Q_OBJECT
36 Q_PROPERTY( int band READ currentBand WRITE setBand NOTIFY bandChanged )
37
38 public:
42 QgsRasterBandComboBox( QWidget *parent SIP_TRANSFERTHIS = nullptr );
43
48 QgsRasterLayer *layer() const;
49
55 int currentBand() const;
56
61 bool isShowingNotSetOption() const;
62
69 void setShowNotSetOption( bool show, const QString &string = QString() );
70
74 static QString displayBandName( QgsRasterDataProvider *provider, int band );
75
76 public slots:
77
83 void setLayer( QgsMapLayer *layer );
84
89 void setBand( int band );
90
91 signals:
92
96 void bandChanged( int band );
97
98 private:
99 QPointer<QgsRasterLayer> mLayer;
100
101 bool mShowNotSet = false;
102 QString mNotSetString;
103 int mPrevBand = -1;
104};
105
106#endif // QGSRASTERBANDCOMBOBOX_H
Base class for all map layer types.
Definition qgsmaplayer.h:76
A combobox widget which displays the bands present in a raster layer.
void bandChanged(int band)
Emitted when the currently selected band changes.
Base class for raster data providers.
Represents a raster layer.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53