Skip to content

Commit 1220374

Browse files
lukas-wPhysSong
authored andcommitted
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.
1 parent a2cb7e9 commit 1220374

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/gui/widgets/EffectView.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include <QMdiSubWindow>
3030
#include <QPainter>
3131
#include <QWhatsThis>
32+
#include <QLayout>
3233

3334
#include "EffectView.h"
3435
#include "DummyEffect.h"
@@ -109,7 +110,9 @@ EffectView::EffectView( Effect * _model, QWidget * _parent ) :
109110
{
110111
m_subWindow = gui->mainWindow()->addWindowedWidget( m_controlView );
111112
m_subWindow->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
112-
m_subWindow->setFixedSize( m_subWindow->size() );
113+
if (m_subWindow->layout()) {
114+
m_subWindow->layout()->setSizeConstraint(QLayout::SetFixedSize);
115+
}
113116

114117
Qt::WindowFlags flags = m_subWindow->windowFlags();
115118
flags &= ~Qt::WindowMaximizeButtonHint;

0 commit comments

Comments
 (0)