QGIS API Documentation
4.3.0-Master (52aa6503bed)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
gui
raster
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
23
#include <QComboBox>
24
#include <QPointer>
25
26
class
QgsMapLayer
;
27
class
QgsRasterDataProvider
;
28
34
class
GUI_EXPORT
QgsRasterBandComboBox
:
public
QComboBox
35
{
36
Q_OBJECT
37
Q_PROPERTY(
int
band
READ
currentBand
WRITE
setBand
NOTIFY
bandChanged
)
38
39
public
:
43
QgsRasterBandComboBox
( QWidget *parent
SIP_TRANSFERTHIS
=
nullptr
);
44
49
QgsRasterLayer
*
layer
()
const
;
50
56
int
currentBand
()
const
;
57
62
bool
isShowingNotSetOption
()
const
;
63
70
void
setShowNotSetOption
(
bool
show,
const
QString &
string
= QString() );
71
75
static
QString
displayBandName
(
QgsRasterDataProvider
*provider,
int
band
);
76
77
public
slots:
78
84
void
setLayer
(
QgsMapLayer
*
layer
);
85
90
void
setBand
(
int
band
);
91
92
signals:
93
97
void
bandChanged
(
int
band
);
98
99
private
:
100
QPointer<QgsRasterLayer> mLayer;
101
102
bool
mShowNotSet =
false
;
103
QString mNotSetString;
104
int
mPrevBand = -1;
105
};
106
107
#endif
// QGSRASTERBANDCOMBOBOX_H
QgsMapLayer
Base class for all map layer types.
Definition
qgsmaplayer.h:83
QgsRasterBandComboBox::layer
QgsRasterLayer * layer() const
Returns the layer currently associated with the combobox.
Definition
qgsrasterbandcombobox.cpp:67
QgsRasterBandComboBox::bandChanged
void bandChanged(int band)
Emitted when the currently selected band changes.
QgsRasterBandComboBox::setShowNotSetOption
void setShowNotSetOption(bool show, const QString &string=QString())
Sets whether the combo box should show the "not set" option.
Definition
qgsrasterbandcombobox.cpp:164
QgsRasterBandComboBox::band
int band
Definition
qgsrasterbandcombobox.h:37
QgsRasterBandComboBox::currentBand
int currentBand() const
Returns the current band number selected in the combobox, or -1 if no band is selected.
Definition
qgsrasterbandcombobox.cpp:72
QgsRasterBandComboBox::QgsRasterBandComboBox
QgsRasterBandComboBox(QWidget *parent=nullptr)
Constructor for QgsRasterBandComboBox.
Definition
qgsrasterbandcombobox.cpp:27
QgsRasterBandComboBox::setLayer
void setLayer(QgsMapLayer *layer)
Sets the raster layer for which the bands are listed in the combobox.
Definition
qgsrasterbandcombobox.cpp:91
QgsRasterBandComboBox::displayBandName
static QString displayBandName(QgsRasterDataProvider *provider, int band)
Returns a user-friendly band name for the specified band.
Definition
qgsrasterbandcombobox.cpp:171
QgsRasterBandComboBox::isShowingNotSetOption
bool isShowingNotSetOption() const
Returns true if the combo box is showing the "not set" option.
Definition
qgsrasterbandcombobox.cpp:159
QgsRasterBandComboBox::setBand
void setBand(int band)
Sets the current band number selected in the combobox.
Definition
qgsrasterbandcombobox.cpp:139
QgsRasterDataProvider
Base class for raster data providers.
Definition
qgsrasterdataprovider.h:94
QgsRasterLayer
Represents a raster layer.
Definition
qgsrasterlayer.h:82
qgis_sip.h
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:52
qgsrasterlayer.h
Generated on
for QGIS API Documentation by
1.17.0