Better fix for legend and title in sub plots and summary dialog

This commit is contained in:
Gaute Lindkvist
2020-09-17 10:02:58 +02:00
committed by Magne Sjaastad
parent 377274cdec
commit 9391453c2c
26 changed files with 79 additions and 47 deletions

View File

@@ -199,6 +199,10 @@ Qt::DropActions RiuDragDrop::supportedDropActions() const
{
return Qt::CopyAction;
}
else if ( RiuTypedPdmObjects<RimPlot>::containsTypedObjects( m_dragItems ) )
{
// return Qt::CopyAction;
}
return Qt::MoveAction;
}

View File

@@ -191,11 +191,9 @@ void RiuMultiPlotBook::removePlot( RiuQwtPlotWidget* plotWidget )
//--------------------------------------------------------------------------------------------------
void RiuMultiPlotBook::removeAllPlots()
{
auto plotWidgets = m_plotWidgets;
for ( RiuQwtPlotWidget* plotWidget : plotWidgets )
{
removePlot( plotWidget );
}
deleteAllPages();
m_plotWidgets.clear();
scheduleUpdate();
}
//--------------------------------------------------------------------------------------------------
@@ -483,6 +481,7 @@ QList<QPointer<RiuQwtPlotWidget>> RiuMultiPlotBook::visiblePlotWidgets() const
QList<QPointer<RiuQwtPlotWidget>> plotWidgets;
for ( QPointer<RiuQwtPlotWidget> plotWidget : m_plotWidgets )
{
CAF_ASSERT( plotWidget );
if ( plotWidget->isChecked() )
{
plotWidgets.push_back( plotWidget );
@@ -534,6 +533,7 @@ void RiuMultiPlotBook::createPages()
row = 0;
column = 0;
}
CAF_ASSERT( plotWidgets[visibleIndex] );
page->addPlot( plotWidgets[visibleIndex] );
page->performUpdate();
}

View File

@@ -155,7 +155,7 @@ void RiuMultiPlotPage::insertPlot( RiuQwtPlotWidget* plotWidget, size_t index )
m_subTitles.insert( static_cast<int>( index ), subTitle );
RiuQwtPlotLegend* legend = nullptr;
if ( m_plotDefinition->legendsVisible() )
if ( m_plotDefinition->legendsVisible() && plotWidget->plotDefinition()->legendsVisible() )
{
legend = new RiuQwtPlotLegend( this );
int legendColumns = 1;

View File

@@ -290,7 +290,7 @@ void RiuQwtPlotWidget::setLegendFontSize( int fontSize )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuQwtPlotWidget::setLegendVisible( bool visible )
void RiuQwtPlotWidget::setInternalLegendVisible( bool visible )
{
if ( visible )
{

View File

@@ -91,7 +91,7 @@ public:
void setPlotTitleFontSize( int titleFontSize );
void setLegendFontSize( int fontSize );
void setLegendVisible( bool visible );
void setInternalLegendVisible( bool visible );
QwtInterval axisRange( QwtPlot::Axis axis ) const;
void setAxisRange( QwtPlot::Axis axis, double min, double max );

View File

@@ -131,7 +131,7 @@ RiuSummaryQwtPlot::RiuSummaryQwtPlot( RimSummaryPlot* plot, QWidget* parent /*=
RiuQwtPlotTools::setCommonPlotBehaviour( this );
RiuQwtPlotTools::setDefaultAxes( this );
setLegendVisible( true );
setInternalLegendVisible( true );
}
//--------------------------------------------------------------------------------------------------