Skip to content

Commit 2fe4a1d

Browse files
author
timlinux
committed
Fixed bug where histogram disappears when defocussing then focusing histogram tab
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14387 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent deffaaf commit 2fe4a1d

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/app/qgsrasterlayerproperties.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,9 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer* lyr, QgsMapCanv
276276
listWidget->setCurrentRow( settings.value( "/Windows/RasterLayerProperties/row" ).toInt() );
277277

278278
setWindowTitle( tr( "Layer Properties - %1" ).arg( lyr->name() ) );
279+
mpHistogramLayout = new QVBoxLayout( mChartWidget );
280+
mpHistogramLayout->setContentsMargins( 0, 0, 0, 0 );
281+
mChartWidget->setLayout( mpHistogramLayout );
279282
} // QgsRasterLayerProperties ctor
280283

281284

@@ -1863,10 +1866,7 @@ void QgsRasterLayerProperties::refreshHistogram()
18631866
mpPlot = new QwtPlot( mChartWidget );
18641867
//ensure all children get removed
18651868
mpPlot->setAutoDelete( true );
1866-
QVBoxLayout *mpHistogramLayout = new QVBoxLayout( mChartWidget );
1867-
mpHistogramLayout->setContentsMargins( 0, 0, 0, 0 );
18681869
mpHistogramLayout->addWidget( mpPlot );
1869-
mChartWidget->setLayout( mpHistogramLayout );
18701870
mpPlot->setTitle( QObject::tr( "Raster Histogram") );
18711871
mpPlot->insertLegend( new QwtLegend(), QwtPlot::BottomLegend );
18721872
// Set axis titles

src/app/qgsrasterlayerproperties.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include "qgscolorrampshader.h"
2727
#include "qgscontexthelp.h"
2828

29-
29+
class QVBoxLayout;
3030
class QgsMapLayer;
3131
class QgsMapCanvas;
3232
class QgsRasterLayer;
@@ -222,6 +222,7 @@ class QgsRasterLayerProperties : public QDialog, private Ui::QgsRasterLayerPrope
222222
QgsMapCanvas* mMapCanvas;
223223
QgsPixelSelectorTool* mPixelSelectorTool;
224224
QwtPlot * mpPlot;
225+
QVBoxLayout *mpHistogramLayout;
225226
};
226227

227228
/**

0 commit comments

Comments
 (0)