From 031556cc3d645cc8c9fddda9ae5350412dccdcf9 Mon Sep 17 00:00:00 2001 From: Gaute Lindkvist Date: Tue, 28 Jan 2020 10:47:45 +0100 Subject: [PATCH] #5416 Set minimum size hint for plot widgets to 0, 0 --- .../UserInterface/RiuQwtPlotWidget.cpp | 18 +++++++++++++++++- .../UserInterface/RiuQwtPlotWidget.h | 3 +++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/ApplicationCode/UserInterface/RiuQwtPlotWidget.cpp b/ApplicationCode/UserInterface/RiuQwtPlotWidget.cpp index 76c75ffa83..249810c720 100644 --- a/ApplicationCode/UserInterface/RiuQwtPlotWidget.cpp +++ b/ApplicationCode/UserInterface/RiuQwtPlotWidget.cpp @@ -76,7 +76,7 @@ RiuQwtPlotWidget::RiuQwtPlotWidget( RimPlot* plotDefinition, QWidget* parent ) this->installEventFilter( this ); this->canvas()->installEventFilter( this ); - this->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding ); + this->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ); } //-------------------------------------------------------------------------------------------------- @@ -649,6 +649,22 @@ void RiuQwtPlotWidget::applyAxisTitleToQwt( QwtPlot::Axis axis ) } } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QSize RiuQwtPlotWidget::sizeHint() const +{ + return QSize( 0, 0 ); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +QSize RiuQwtPlotWidget::minimumSizeHint() const +{ + return QSize( 0, 0 ); +} + //-------------------------------------------------------------------------------------------------- /// Empty default implementation //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/UserInterface/RiuQwtPlotWidget.h b/ApplicationCode/UserInterface/RiuQwtPlotWidget.h index 1b5404b66e..5b74742291 100644 --- a/ApplicationCode/UserInterface/RiuQwtPlotWidget.h +++ b/ApplicationCode/UserInterface/RiuQwtPlotWidget.h @@ -138,6 +138,9 @@ protected: void applyPlotTitleToQwt(); void applyAxisTitleToQwt( QwtPlot::Axis axis ); + QSize sizeHint() const override; + QSize minimumSizeHint() const override; + virtual void selectPoint( QwtPlotCurve* curve, int pointNumber ); virtual void clearPointSelection(); virtual bool isZoomerActive() const;