Skip to content
Permalink
Browse files

[bugfix] Crash on raster layer render change from python

Backported from master PR #5696

Fixes #17517
  • Loading branch information
elpaso committed Nov 27, 2017
1 parent f206a75 commit fa7082b9f500458d7c27a789e78f9ac14daeae0c
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 fa7082b

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