Skip to content
Permalink
Browse files

Merge pull request #5742 from elpaso/backport-bugfix-17517

[bugfix] Crash on raster layer render change from python
  • Loading branch information
elpaso committed Nov 28, 2017
2 parents 5631094 + fa7082b commit 92049054791111ec3cd11691190df6669c18c311
Showing with 11 additions and 8 deletions.
  1. +11 −8 src/gui/raster/qgssinglebandgrayrendererwidget.cpp
@@ -152,14 +152,17 @@ void QgsSingleBandGrayRendererWidget::setFromRenderer( const QgsRasterRenderer*
{
//band
mGrayBandComboBox->setCurrentIndex( mGrayBandComboBox->findData( gr->grayBand() ) );
const QgsContrastEnhancement* ce = gr->contrastEnhancement();

mGradientComboBox->setCurrentIndex( mGradientComboBox->findData( gr->gradient() ) );
//minmax
mMinLineEdit->setText( QString::number( ce->minimumValue() ) );
mMaxLineEdit->setText( QString::number( ce->maximumValue() ) );
//contrast enhancement algorithm
mContrastEnhancementComboBox->setCurrentIndex(
mContrastEnhancementComboBox->findData(( int )( ce->contrastEnhancementAlgorithm() ) ) );

const QgsContrastEnhancement* ce = gr->contrastEnhancement();
if ( ce )
{
//minmax
mMinLineEdit->setText( QString::number( ce->minimumValue() ) );
mMaxLineEdit->setText( QString::number( ce->maximumValue() ) );
//contrast enhancement algorithm
mContrastEnhancementComboBox->setCurrentIndex(
mContrastEnhancementComboBox->findData(( int )( ce->contrastEnhancementAlgorithm() ) ) );
}
}
}

0 comments on commit 9204905

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