From 3a90bf1e766c1f1f555516a315e8fa4b6c4466a4 Mon Sep 17 00:00:00 2001 From: Gaute Lindkvist Date: Wed, 9 Oct 2019 20:25:25 +0200 Subject: [PATCH] Use QwtPlotZoneItems instead of QwtPlotShapeItems for formations --- .../UserInterface/RiuPlotAnnotationTool.cpp | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/ApplicationCode/UserInterface/RiuPlotAnnotationTool.cpp b/ApplicationCode/UserInterface/RiuPlotAnnotationTool.cpp index 258f35cb9b..1180b49614 100644 --- a/ApplicationCode/UserInterface/RiuPlotAnnotationTool.cpp +++ b/ApplicationCode/UserInterface/RiuPlotAnnotationTool.cpp @@ -25,7 +25,7 @@ #include "cvfMath.h" #include "qwt_plot.h" -#include "qwt_plot_shapeitem.h" +#include "qwt_plot_zoneitem.h" #include @@ -84,21 +84,14 @@ void RiuPlotAnnotationTool::attachNamedRegions( QwtPlot* cvf::Color3ub cvfColor = catMapper.mapToColor( static_cast( i ) ); QColor shadingColor( cvfColor.r(), cvfColor.g(), cvfColor.b(), shadingAlphaByte ); - QwtPlotShapeItem* shading = new QwtPlotShapeItem( name ); - - QwtInterval axisInterval = m_plot->axisInterval( QwtPlot::xBottom ); - - QRectF shadingRect( axisInterval.minValue(), - yPositions[i].first, - axisInterval.width(), - yPositions[i].second - yPositions[i].first ); - - shading->setRect( shadingRect ); + QwtPlotZoneItem* shading = new QwtPlotZoneItem(); + shading->setOrientation( Qt::Horizontal ); + shading->setInterval( yPositions[i].first, yPositions[i].second ); shading->setPen( shadingColor, 0.0, Qt::NoPen ); shading->setBrush( QBrush( shadingColor ) ); shading->attach( m_plot ); shading->setZ( -100.0 ); - shading->setXAxis( QwtPlot::xBottom ); + shading->setXAxis( QwtPlot::xTop ); m_markers.push_back( std::move( shading ) ); }