#9233 Correction Report Plot: disable axes alignment for better spacing.

Regression introduced in 71d18b9e76.
This commit is contained in:
Kristian Bendiksen 2022-08-29 15:11:21 +02:00 committed by Magne Sjaastad
parent 1f8cc7f477
commit fe62fb76ff
3 changed files with 15 additions and 2 deletions

View File

@ -281,6 +281,7 @@ void RimCorrelationReportPlot::doRenderWindowContent( QPaintDevice* paintDevice
QWidget* RimCorrelationReportPlot::createViewWidget( QWidget* mainWindowParent /*= nullptr */ ) QWidget* RimCorrelationReportPlot::createViewWidget( QWidget* mainWindowParent /*= nullptr */ )
{ {
m_viewer = new RiuMultiPlotPage( this, mainWindowParent ); m_viewer = new RiuMultiPlotPage( this, mainWindowParent );
m_viewer->setAutoAlignAxes( false );
m_viewer->setPlotTitle( m_plotWindowTitle() ); m_viewer->setPlotTitle( m_plotWindowTitle() );
recreatePlotWidgets(); recreatePlotWidgets();

View File

@ -82,6 +82,7 @@ RiuMultiPlotPage::RiuMultiPlotPage( RimPlotWindow* plotDefinition, QWidget* pare
, m_plotDefinition( plotDefinition ) , m_plotDefinition( plotDefinition )
, m_previewMode( false ) , m_previewMode( false )
, m_showSubTitles( false ) , m_showSubTitles( false )
, m_autoAlignAxes( true )
, m_titleFontPixelSize( 12 ) , m_titleFontPixelSize( 12 )
, m_subTitleFontPixelSize( 11 ) , m_subTitleFontPixelSize( 11 )
, m_legendFontPixelSize( 8 ) , m_legendFontPixelSize( 8 )
@ -595,7 +596,7 @@ void RiuMultiPlotPage::performUpdate( RiaDefines::MultiPlotPageUpdateType whatTo
reinsertPlotWidgets(); reinsertPlotWidgets();
alignCanvasTops(); alignCanvasTops();
alignAxes(); if ( m_autoAlignAxes ) alignAxes();
return; return;
} }
@ -603,7 +604,7 @@ void RiuMultiPlotPage::performUpdate( RiaDefines::MultiPlotPageUpdateType whatTo
{ {
refreshLegends(); refreshLegends();
alignCanvasTops(); alignCanvasTops();
alignAxes(); if ( m_autoAlignAxes ) alignAxes();
} }
if ( ( whatToUpdate & RiaDefines::MultiPlotPageUpdateType::TITLE ) == RiaDefines::MultiPlotPageUpdateType::TITLE ) if ( ( whatToUpdate & RiaDefines::MultiPlotPageUpdateType::TITLE ) == RiaDefines::MultiPlotPageUpdateType::TITLE )
@ -1177,3 +1178,11 @@ void RiuMultiPlotPage::alignAxis( QwtAxisId axis, int targetRowOrColumn, std::fu
} }
} }
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuMultiPlotPage::setAutoAlignAxes( bool autoAlignAxes )
{
m_autoAlignAxes = autoAlignAxes;
}

View File

@ -82,6 +82,8 @@ public:
bool previewModeEnabled() const; bool previewModeEnabled() const;
void setPagePreviewModeEnabled( bool previewMode ); void setPagePreviewModeEnabled( bool previewMode );
void setAutoAlignAxes( bool autoAlignAxes );
void scheduleUpdate( RiaDefines::MultiPlotPageUpdateType whatToUpdate = RiaDefines::MultiPlotPageUpdateType::ALL ); void scheduleUpdate( RiaDefines::MultiPlotPageUpdateType whatToUpdate = RiaDefines::MultiPlotPageUpdateType::ALL );
void scheduleReplotOfAllPlots(); void scheduleReplotOfAllPlots();
virtual void updateVerticalScrollBar( double visibleMin, double visibleMax, double totalMin, double totalMax ) {} virtual void updateVerticalScrollBar( double visibleMin, double visibleMax, double totalMin, double totalMax ) {}
@ -185,6 +187,7 @@ protected:
bool m_previewMode; bool m_previewMode;
bool m_showSubTitles; bool m_showSubTitles;
bool m_autoAlignAxes;
std::map<RiuQwtPlotLegend*, int> m_childCountForAdjustSizeOperation; std::map<RiuQwtPlotLegend*, int> m_childCountForAdjustSizeOperation;