From 6220ff160c70aae17ee4bc417227561ef0436407 Mon Sep 17 00:00:00 2001 From: Gaute Lindkvist Date: Thu, 24 Sep 2020 14:59:28 +0200 Subject: [PATCH] Fix a Qt warning for getContentsMargins --- ApplicationCode/UserInterface/RiuQwtPlotLegend.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ApplicationCode/UserInterface/RiuQwtPlotLegend.cpp b/ApplicationCode/UserInterface/RiuQwtPlotLegend.cpp index 541f4f27ca..5c5e251da9 100644 --- a/ApplicationCode/UserInterface/RiuQwtPlotLegend.cpp +++ b/ApplicationCode/UserInterface/RiuQwtPlotLegend.cpp @@ -49,10 +49,10 @@ void RiuQwtPlotLegend::resizeEvent( QResizeEvent* event ) const QwtDynGridLayout* legendLayout = qobject_cast( 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(); }