Fix bug in QwtPlotWidget highlight reset

QwtPlotShapeItem objects were not reset
This commit is contained in:
Jørgen Herje 2023-01-26 14:42:00 +01:00 committed by Magne Sjaastad
parent 057bb73a27
commit 02b1c971e8

View File

@ -1055,7 +1055,7 @@ void RiuQwtPlotWidget::resetPlotItemHighlighting( bool doUpdateCurveOrder )
{
if ( !m_originalZValues.empty() )
{
auto plotItemList = m_plot->itemList();
const auto& plotItemList = m_plot->itemList();
for ( QwtPlotItem* plotItem : plotItemList )
{
if ( auto* plotCurve = dynamic_cast<QwtPlotCurve*>( plotItem ) )
@ -1071,23 +1071,27 @@ void RiuQwtPlotWidget::resetPlotItemHighlighting( bool doUpdateCurveOrder )
continue;
}
}
auto* plotShapeItem = dynamic_cast<QwtPlotShapeItem*>( plotItem );
if ( plotShapeItem )
{
QPen pen = plotShapeItem->pen();
auto color = RiuGuiTheme::getColorByVariableName( "markerColor" );
pen.setColor( color );
pen.setWidth( 1 );
plotShapeItem->setPen( pen );
plotShapeItem->setZ( plotShapeItem->z() - 100.0 );
}
}
m_originalZValues.clear();
}
const auto& plotItemList = m_plot->itemList();
for ( QwtPlotItem* plotItem : plotItemList )
{
auto* plotShapeItem = dynamic_cast<QwtPlotShapeItem*>( plotItem );
if ( plotShapeItem )
{
QPen pen = plotShapeItem->pen();
auto color = RiuGuiTheme::getColorByVariableName( "markerColor" );
pen.setColor( color );
pen.setWidth( 1 );
plotShapeItem->setPen( pen );
plotShapeItem->setZ( plotShapeItem->z() - 100.0 );
}
}
resetPlotAxisHighlighting();
if ( doUpdateCurveOrder ) updateCurveOrder();