mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#8522 Summary Plot: ensure plot axis are restore when creating plots.
This commit is contained in:
parent
2e6795bd1d
commit
bd22336ba8
@ -2006,6 +2006,11 @@ RiuPlotWidget* RimSummaryPlot::doCreatePlotViewWidget( QWidget* mainWindowParent
|
|||||||
m_summaryPlot = std::make_unique<RiuSummaryQwtPlot>( this, mainWindowParent );
|
m_summaryPlot = std::make_unique<RiuSummaryQwtPlot>( this, mainWindowParent );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
for ( auto axisProperties : m_axisProperties )
|
||||||
|
{
|
||||||
|
plotWidget()->ensureAxis( axisProperties->plotAxisType() );
|
||||||
|
}
|
||||||
|
|
||||||
for ( RimGridTimeHistoryCurve* curve : m_gridTimeHistoryCurves )
|
for ( RimGridTimeHistoryCurve* curve : m_gridTimeHistoryCurves )
|
||||||
{
|
{
|
||||||
curve->setParentPlotNoReplot( plotWidget() );
|
curve->setParentPlotNoReplot( plotWidget() );
|
||||||
|
@ -153,6 +153,8 @@ public:
|
|||||||
|
|
||||||
virtual int axisExtent( RiuPlotAxis axis ) const = 0;
|
virtual int axisExtent( RiuPlotAxis axis ) const = 0;
|
||||||
|
|
||||||
|
virtual void ensureAxis( RiuPlotAxis axis ) = 0;
|
||||||
|
|
||||||
QPoint dragStartPosition() const;
|
QPoint dragStartPosition() const;
|
||||||
|
|
||||||
void scheduleReplot();
|
void scheduleReplot();
|
||||||
|
@ -860,13 +860,21 @@ void RiuQtChartsPlotWidget::setYAxis( RiuPlotAxis axis, QtCharts::QAbstractSerie
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuQtChartsPlotWidget::setAxis( RiuPlotAxis axis, QtCharts::QAbstractSeries* series )
|
void RiuQtChartsPlotWidget::ensureAxis( RiuPlotAxis axis )
|
||||||
{
|
{
|
||||||
// Make sure the axis we are about to set exists.
|
|
||||||
if ( m_axes.find( axis ) == m_axes.end() )
|
if ( m_axes.find( axis ) == m_axes.end() )
|
||||||
{
|
{
|
||||||
addAxis( axis, true, true );
|
addAxis( axis, true, true );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RiuQtChartsPlotWidget::setAxis( RiuPlotAxis axis, QtCharts::QAbstractSeries* series )
|
||||||
|
{
|
||||||
|
// Make sure the axis we are about to set exists.
|
||||||
|
ensureAxis( axis );
|
||||||
|
|
||||||
if ( qtChart()->series().contains( series ) && !series->attachedAxes().contains( plotAxis( axis ) ) )
|
if ( qtChart()->series().contains( series ) && !series->attachedAxes().contains( plotAxis( axis ) ) )
|
||||||
{
|
{
|
||||||
|
@ -134,6 +134,8 @@ public:
|
|||||||
|
|
||||||
int axisExtent( RiuPlotAxis axis ) const override;
|
int axisExtent( RiuPlotAxis axis ) const override;
|
||||||
|
|
||||||
|
void ensureAxis( RiuPlotAxis axis ) override;
|
||||||
|
|
||||||
QPoint dragStartPosition() const;
|
QPoint dragStartPosition() const;
|
||||||
|
|
||||||
void scheduleReplot();
|
void scheduleReplot();
|
||||||
|
@ -1048,6 +1048,13 @@ QwtPlot* RiuQwtPlotWidget::qwtPlot() const
|
|||||||
return m_plot;
|
return m_plot;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RiuQwtPlotWidget::ensureAxis( RiuPlotAxis axis )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -131,6 +131,8 @@ public:
|
|||||||
|
|
||||||
int axisExtent( RiuPlotAxis axis ) const override;
|
int axisExtent( RiuPlotAxis axis ) const override;
|
||||||
|
|
||||||
|
void ensureAxis( RiuPlotAxis axis ) override;
|
||||||
|
|
||||||
QPoint dragStartPosition() const;
|
QPoint dragStartPosition() const;
|
||||||
|
|
||||||
void scheduleReplot();
|
void scheduleReplot();
|
||||||
|
Loading…
Reference in New Issue
Block a user