mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#8938 Sub Plot : Fix visibility of legend
Make sure legends are set visible if any items are present in the legend
This commit is contained in:
parent
787d3ae379
commit
fe1acc93a6
@ -600,7 +600,11 @@ void RiuMultiPlotPage::onLegendUpdated()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMultiPlotPage::refreshLegends()
|
||||
{
|
||||
// TODO - might need to do something here, but at the moment it looks like alignCanvasTops() is sufficient
|
||||
QList<QPointer<RiuQwtPlotLegend>> legends = this->legendsForVisiblePlots();
|
||||
for ( const auto& l : legends )
|
||||
{
|
||||
l->setVisible( !l->isEmpty() );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -108,7 +108,6 @@ QSize RiuQwtPlotLegend::sizeHint() const
|
||||
void RiuQwtPlotLegend::updateLegend( const QVariant& variant, const QList<QwtLegendData>& legendItems )
|
||||
{
|
||||
QwtLegend::updateLegend( variant, legendItems );
|
||||
setVisible( !legendItems.empty() );
|
||||
emit legendUpdated();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user