Fix a Qt warning for getContentsMargins

This commit is contained in:
Gaute Lindkvist 2020-09-24 14:59:28 +02:00
parent 8f5c38cb8e
commit 6220ff160c

View File

@ -49,10 +49,10 @@ void RiuQwtPlotLegend::resizeEvent( QResizeEvent* event )
const QwtDynGridLayout* legendLayout = qobject_cast<QwtDynGridLayout*>( contentsWidget()->layout() );
if ( legendLayout )
{
int left, right, top, bottom;
getContentsMargins( &left, &top, &right, &bottom );
QMargins margins = this->contentsMargins();
m_columnCount = std::max( 1, (int)legendLayout->columnsForWidth( size.width() - left - right ) );
m_columnCount =
std::max( 1, (int)legendLayout->columnsForWidth( size.width() - margins.left() - margins.right() ) );
updateGeometry();
}