mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Add word wrap for titles for Multi plot and Accumulated Phase Fractions plots
This commit is contained in:
parent
eed729f2fe
commit
a2fef2237d
@ -160,6 +160,7 @@ void RiuMultiPlotPage::insertPlot( RiuQwtPlotWidget* plotWidget, size_t index )
|
|||||||
QString subTitleText = plotWidget->plotTitle();
|
QString subTitleText = plotWidget->plotTitle();
|
||||||
QLabel* subTitle = new QLabel( subTitleText );
|
QLabel* subTitle = new QLabel( subTitleText );
|
||||||
subTitle->setAlignment( Qt::AlignHCenter );
|
subTitle->setAlignment( Qt::AlignHCenter );
|
||||||
|
subTitle->setWordWrap( true );
|
||||||
subTitle->setVisible( false );
|
subTitle->setVisible( false );
|
||||||
m_subTitles.insert( static_cast<int>( index ), subTitle );
|
m_subTitles.insert( static_cast<int>( index ), subTitle );
|
||||||
|
|
||||||
|
@ -61,8 +61,9 @@ RiuTofAccumulatedPhaseFractionsPlot::RiuTofAccumulatedPhaseFractionsPlot( RimTof
|
|||||||
setDefaults();
|
setDefaults();
|
||||||
QwtText title( "Cumulative Saturation by Time of Flight" );
|
QwtText title( "Cumulative Saturation by Time of Flight" );
|
||||||
QFont titleFont = title.font();
|
QFont titleFont = title.font();
|
||||||
titleFont.setPointSize( 12 );
|
titleFont.setPointSize( 10 );
|
||||||
title.setFont( titleFont );
|
title.setFont( titleFont );
|
||||||
|
title.setRenderFlags( title.renderFlags() | Qt::TextWordWrap );
|
||||||
setTitle( title );
|
setTitle( title );
|
||||||
|
|
||||||
m_watCurve = new QwtPlotCurve;
|
m_watCurve = new QwtPlotCurve;
|
||||||
@ -120,7 +121,11 @@ RiuTofAccumulatedPhaseFractionsPlot::~RiuTofAccumulatedPhaseFractionsPlot()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
QSize RiuTofAccumulatedPhaseFractionsPlot::sizeHint() const
|
QSize RiuTofAccumulatedPhaseFractionsPlot::sizeHint() const
|
||||||
{
|
{
|
||||||
return QSize( 370, 250 );
|
QSize plotSizeHint = QwtPlot::sizeHint();
|
||||||
|
|
||||||
|
plotSizeHint.setWidth( std::max( plotSizeHint.width(), 400 ) );
|
||||||
|
plotSizeHint.setHeight( std::max( plotSizeHint.height(), 250 ) );
|
||||||
|
return plotSizeHint;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -206,7 +211,7 @@ void RiuTofAccumulatedPhaseFractionsPlot::setDefaults()
|
|||||||
setAxisMaxMinor( QwtPlot::xBottom, 2 );
|
setAxisMaxMinor( QwtPlot::xBottom, 2 );
|
||||||
setAxisMaxMinor( QwtPlot::yLeft, 3 );
|
setAxisMaxMinor( QwtPlot::yLeft, 3 );
|
||||||
|
|
||||||
QSizePolicy sizePolicy( QSizePolicy::Maximum, QSizePolicy::Maximum );
|
QSizePolicy sizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred );
|
||||||
sizePolicy.setHeightForWidth( true );
|
sizePolicy.setHeightForWidth( true );
|
||||||
setSizePolicy( sizePolicy );
|
setSizePolicy( sizePolicy );
|
||||||
updateGeometry();
|
updateGeometry();
|
||||||
|
Loading…
Reference in New Issue
Block a user