Disable horz. scrollbar for legends

This commit is contained in:
jonjenssen authored and Magne Sjaastad committed 2023-03-16 07:16:11 +01:00
1 parent 1c14e99832
commit 5879c8a9b9
1 file changed
+4 -1
@@ -26,6 +26,7 @@
#include <QDebug>
#include <QResizeEvent>
#include <QScrollArea>
#include <QVariant>
#include <utility>
@@ -35,7 +36,6 @@
//--------------------------------------------------------------------------------------------------
RiuQwtPlotLegend::RiuQwtPlotLegend( QWidget* parent /*= nullptr */ )
: QwtLegend( parent )
{
auto* legendLayout = qobject_cast<QwtDynGridLayout*>( contentsWidget()->layout() );
if ( legendLayout )
@@ -44,6 +44,9 @@ RiuQwtPlotLegend::RiuQwtPlotLegend( QWidget* parent /*= nullptr */ )
legendLayout->setSpacing( 1 );
}
setSizePolicy( QSizePolicy::Preferred, QSizePolicy::MinimumExpanding );
QScrollArea* scrollArea = findChild<QScrollArea*>( "QwtLegendView" );
if ( scrollArea ) scrollArea->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
}
//--------------------------------------------------------------------------------------------------