Permalink
Browse files

Fix effect dialog layout glitches

QMdiSubWindow::setSizePolicy doesn't have any effect because QMdiSubWindow
uses a layout. This patch uses QMdiSubWindow::layout()->setSizeConstraint
instead. This may cause effects that don't have a layout and don't
implement sizeHint() to now be resizable. For effects that do though, it
fixes the size constraint.
  • Loading branch information...
lukas-w authored and PhysSong committed Feb 10, 2018
1 parent a2cb7e9 commit 1220374a7f03d91baae50abb665d8bed0f49c43b
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/gui/widgets/EffectView.cpp
@@ -29,6 +29,7 @@
#include <QMdiSubWindow>
#include <QPainter>
#include <QWhatsThis>
#include <QLayout>
#include "EffectView.h"
#include "DummyEffect.h"
@@ -109,7 +110,9 @@ EffectView::EffectView( Effect * _model, QWidget * _parent ) :
{
m_subWindow = gui->mainWindow()->addWindowedWidget( m_controlView );
m_subWindow->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
m_subWindow->setFixedSize( m_subWindow->size() );
if (m_subWindow->layout()) {
m_subWindow->layout()->setSizeConstraint(QLayout::SetFixedSize);
}
Qt::WindowFlags flags = m_subWindow->windowFlags();
flags &= ~Qt::WindowMaximizeButtonHint;

0 comments on commit 1220374

Please sign in to comment.