Skip to content
Prev Previous commit
Next Next commit
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 May 21, 2018
commit bf987583589f4f633a408b718a6b4a62bcac9cda
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);
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lukas-w I don't know if it's needed, but isn't it safe to keep previous behavior(probably with else)?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PhysSong I don't think it's needed, setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) already does that in the else case.


Qt::WindowFlags flags = m_subWindow->windowFlags();
flags &= ~Qt::WindowMaximizeButtonHint;
Expand Down