diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt index 43ae4481cf0..d7f54e31d87 100644 --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -323,6 +323,7 @@ INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR} composer legend attributetable ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/../ui + ${QWT_INCLUDE_DIR} ${QT_QTUITOOLS_INCLUDE_DIR} ../core ../core/gps ../core/gps/qextserialport diff --git a/src/app/qgsrasterlayerproperties.cpp b/src/app/qgsrasterlayerproperties.cpp index 99d98920e63..d942c6d0d63 100644 --- a/src/app/qgsrasterlayerproperties.cpp +++ b/src/app/qgsrasterlayerproperties.cpp @@ -66,8 +66,7 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer* lyr, QgsMapCanv : QDialog( parent, fl ), // Constant that signals property not used. TRSTRING_NOT_SET( tr( "Not Set" ) ), - mRasterLayer( qobject_cast( lyr ) ), - mpPlot( 0 ) + mRasterLayer( qobject_cast( lyr ) ) { ignoreSpinBoxEvent = false; //Short circuit signal loop between min max field and stdDev spin box mGrayMinimumMaximumEstimated = true; @@ -276,9 +275,11 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer* lyr, QgsMapCanv listWidget->setCurrentRow( settings.value( "/Windows/RasterLayerProperties/row" ).toInt() ); setWindowTitle( tr( "Layer Properties - %1" ).arg( lyr->name() ) ); - mpHistogramLayout = new QVBoxLayout( mChartWidget ); - mpHistogramLayout->setContentsMargins( 0, 0, 0, 0 ); - mChartWidget->setLayout( mpHistogramLayout ); + int myHistogramTab = 6; + if ( tabBar->currentIndex() == myHistogramTab ) + { + refreshHistogram(); + } } // QgsRasterLayerProperties ctor @@ -1855,18 +1856,13 @@ void QgsRasterLayerProperties::on_tabBar_currentChanged( int theTab ) void QgsRasterLayerProperties::refreshHistogram() { - if ( mpPlot != 0 ) - { - delete mpPlot; - } + mpPlot->clear(); mHistogramProgress->show(); connect( mRasterLayer, SIGNAL( progressUpdate( int ) ), mHistogramProgress, SLOT( setValue( int ) ) ); QApplication::setOverrideCursor( Qt::WaitCursor ); QgsDebugMsg( "entered." ); - mpPlot = new QwtPlot( mChartWidget ); //ensure all children get removed mpPlot->setAutoDelete( true ); - mpHistogramLayout->addWidget( mpPlot ); mpPlot->setTitle( QObject::tr( "Raster Histogram") ); mpPlot->insertLegend( new QwtLegend(), QwtPlot::BottomLegend ); // Set axis titles diff --git a/src/app/qgsrasterlayerproperties.h b/src/app/qgsrasterlayerproperties.h index 9321c702b69..4791843f366 100644 --- a/src/app/qgsrasterlayerproperties.h +++ b/src/app/qgsrasterlayerproperties.h @@ -26,12 +26,10 @@ #include "qgscolorrampshader.h" #include "qgscontexthelp.h" -class QVBoxLayout; class QgsMapLayer; class QgsMapCanvas; class QgsRasterLayer; class QgsPixelSelectorTool; -class QwtPlot; /**Property sheet for a raster map layer *@author Tim Sutton @@ -221,8 +219,6 @@ class QgsRasterLayerProperties : public QDialog, private Ui::QgsRasterLayerPrope QgsMapCanvas* mMapCanvas; QgsPixelSelectorTool* mPixelSelectorTool; - QwtPlot * mpPlot; - QVBoxLayout *mpHistogramLayout; }; /** diff --git a/src/plugins/georeferencer/CMakeLists.txt b/src/plugins/georeferencer/CMakeLists.txt index 0a7d2307f15..df4dc286803 100644 --- a/src/plugins/georeferencer/CMakeLists.txt +++ b/src/plugins/georeferencer/CMakeLists.txt @@ -76,6 +76,7 @@ INCLUDE_DIRECTORIES( ${GDAL_INCLUDE_DIR} ${GEOS_INCLUDE_DIR} ${QT_QTXML_INCLUDE_DIR} + ${QWT_INCLUDE_DIR} ) TARGET_LINK_LIBRARIES(georefplugin diff --git a/src/ui/qgsrasterlayerpropertiesbase.ui b/src/ui/qgsrasterlayerpropertiesbase.ui index 6da0a721e31..e236f14f719 100644 --- a/src/ui/qgsrasterlayerpropertiesbase.ui +++ b/src/ui/qgsrasterlayerpropertiesbase.ui @@ -7,7 +7,7 @@ 0 0 755 - 618 + 605 @@ -66,7 +66,7 @@ - 0 + 6 @@ -1765,6 +1765,7 @@ p, li { white-space: pre-wrap; } <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;"></p></td></tr></table></body></html> @@ -1834,30 +1835,17 @@ p, li { white-space: pre-wrap; } - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - + + - + 0 - + Save as image... @@ -2046,6 +2034,13 @@ p, li { white-space: pre-wrap; } + + + QwtPlot + QFrame +
qwt_plot.h
+
+
tabBar cboRed