Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Merge pull request #5742 from elpaso/backport-bugfix-17517
[bugfix] Crash on raster layer render change from python
- Loading branch information
Showing
with
11 additions
and
8 deletions.
-
+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() ) ) ); |
|
|
} |
|
|
} |
|
|
} |