Skip to content

Commit

Permalink
Fix effect dialog layout glitches
Browse files Browse the repository at this point in the history
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 May 30, 2018
1 parent a2cb7e9 commit 1220374
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/gui/widgets/EffectView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <QMdiSubWindow>
#include <QPainter>
#include <QWhatsThis>
#include <QLayout>

#include "EffectView.h"
#include "DummyEffect.h"
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 1220374

Please sign in to comment.