Skip to content
Permalink
Browse files

Merge pull request #5696 from elpaso/bugfix-17517-singlebandgrey-crash

[bugfix] Crash on raster layer render change from python

Everything looks good to me, thanks @elpaso
  • Loading branch information
vmora committed Nov 22, 2017
2 parents ade6b60 + 98d2dcb commit 087087f3b2ee08c2b72be3f3aa76ac0af34e3c75
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 087087f

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