Skip to content
Permalink
Browse files

[bugfix] Crash on raster layer render change from python

Fixes #17517

Requires backporting
  • Loading branch information
elpaso committed Nov 22, 2017
1 parent d6d4097 commit 98d2dcbf7acf9e2e60edffb5f2d667dceadf6b0c
Showing with 13 additions and 10 deletions.
  1. +13 −10 src/gui/raster/qgssinglebandgrayrendererwidget.cpp
@@ -180,17 +180,20 @@ void QgsSingleBandGrayRendererWidget::setFromRenderer( const QgsRasterRenderer *
{
//band
mGrayBandComboBox->setBand( gr->grayBand() );
const QgsContrastEnhancement *ce = gr->contrastEnhancement();

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

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

mMinMaxWidget->setFromMinMaxOrigin( gr->minMaxOrigin() );
}

0 comments on commit 98d2dcb

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