Skip to content
Permalink
Browse files

Correctly set band number for pseudocolor renderer widget

Previously the band was always reset to the first band when opening
the raster layer properties.
  • Loading branch information
nyalldawson committed Dec 4, 2014
1 parent 486d408 commit e887d075aa4fb27c20f27e60025d7609ed51b7f3
@@ -24,6 +24,11 @@ class QgsSingleBandPseudoColorRenderer: QgsRasterRenderer

QList<int> usesBands() const;

/**Returns the band used by the renderer
* @note added in QGIS 2.7
*/
int band() const;

double classificationMin() const;
double classificationMax() const;
void setClassificationMin( double min );
@@ -49,6 +49,11 @@ class CORE_EXPORT QgsSingleBandPseudoColorRenderer: public QgsRasterRenderer

QList<int> usesBands() const;

/**Returns the band used by the renderer
* @note added in QGIS 2.7
*/
int band() const { return mBand; }

double classificationMin() const { return mClassificationMin; }
double classificationMax() const { return mClassificationMax; }
void setClassificationMin( double min ) { mClassificationMin = min; }
@@ -561,6 +561,8 @@ void QgsSingleBandPseudoColorRendererWidget::setFromRenderer( const QgsRasterRen
const QgsSingleBandPseudoColorRenderer* pr = dynamic_cast<const QgsSingleBandPseudoColorRenderer*>( r );
if ( pr )
{
mBandComboBox->setCurrentIndex( mBandComboBox->findData( pr->band() ) );

const QgsRasterShader* rasterShader = pr->shader();
if ( rasterShader )
{

0 comments on commit e887d07

Please sign in to comment.
You can’t perform that action at this time.