Skip to content
Permalink
Browse files
[style dock] fix defining min/max values via raster histogram (#4262)
  • Loading branch information
nirvn committed Mar 15, 2017
1 parent 59ad769 commit 4f3cf6889763ae4236c43179504e9c8ce97b6633
Showing with 16 additions and 5 deletions.
  1. +3 −5 src/app/qgslayerstylingwidget.cpp
  2. +13 −0 src/gui/raster/qgsrasterhistogramwidget.cpp
@@ -432,13 +432,11 @@ void QgsLayerStylingWidget::updateCurrentWidgetLayer()
{
if ( rlayer->dataProvider()->capabilities() & QgsRasterDataProvider::Size )
{
if ( mRasterStyleWidget )
if ( !mRasterStyleWidget )
{
mRasterStyleWidget->deleteLater();
delete mRasterStyleWidget;
mRasterStyleWidget = new QgsRendererRasterPropertiesWidget( rlayer, mMapCanvas, mWidgetStack );
mRasterStyleWidget->syncToLayer( rlayer );
}
mRasterStyleWidget = new QgsRendererRasterPropertiesWidget( rlayer, mMapCanvas, mWidgetStack );
mRasterStyleWidget->syncToLayer( rlayer );
connect( mRasterStyleWidget, SIGNAL( widgetChanged() ), this, SLOT( autoApply() ) );

QgsRasterHistogramWidget *widget = new QgsRasterHistogramWidget( rlayer, mWidgetStack );
@@ -20,6 +20,7 @@
#include "qgsrasterrendererregistry.h"
#include "qgsrasterrendererwidget.h"
#include "qgsrasterhistogramwidget.h"
#include "qgsrasterminmaxwidget.h"
#include "qgsrasterdataprovider.h"
#include "qgssettings.h"

@@ -963,7 +964,13 @@ void QgsRasterHistogramWidget::applyHistoMin()
{
min = leHistoMin->text();
if ( mHistoUpdateStyleToMinMax )
{
mRendererWidget->setMin( min, i );
if ( mRendererWidget->minMaxWidget() )
{
mRendererWidget->minMaxWidget()->userHasSetManualMinMaxValues();
}
}
}
}

@@ -992,7 +999,13 @@ void QgsRasterHistogramWidget::applyHistoMax()
{
max = leHistoMax->text();
if ( mHistoUpdateStyleToMinMax )
{
mRendererWidget->setMax( max, i );
if ( mRendererWidget->minMaxWidget() )
{
mRendererWidget->minMaxWidget()->userHasSetManualMinMaxValues();
}
}
}
}

0 comments on commit 4f3cf68

Please sign in to comment.