mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5409 Remove deprecated QFontMetrics::width() call.
Replaced with `QFontMetrics( font ).boundingRect( QString ).width() as suggested in Qt5 docs. The replacement should work for all Qt5 versions as it was available in Qt4 too.
This commit is contained in:
parent
d86de5e8ff
commit
7972ff8c02
@ -180,7 +180,7 @@ void RiuNightchartsWidget::paintEvent( QPaintEvent* e )
|
||||
void RiuNightchartsWidget::addItem( const QString& name, const QColor& color, float value )
|
||||
{
|
||||
m_chart.addPiece( name, color, value );
|
||||
int textWidth = this->fontMetrics().width( name + " (00 %)" );
|
||||
int textWidth = this->fontMetrics().boundingRect( name + " (00 %)" ).width();
|
||||
|
||||
m_maxNameWidth = textWidth > m_maxNameWidth ? textWidth : m_maxNameWidth;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user