From 76504e5e5ee51665ddd37d36e220c9266d84aa53 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 18 May 2009 11:06:06 +0200 Subject: Fixed a bug caused by forms with a sizepolicy of 'Fixed' on the main container. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Restore 4.4 behaviour by using a QStackedLayout as the layout containing the actual form (as was in 4.4). The difference in behaviour was caused by insertion of an additional widget with a QVBoxLayout which is supposed to ease setting of inheritable properties (style, etc). Reviewed-by: Kai Köhne Task-number: 253236 --- tools/designer/src/components/formeditor/formwindow_widgetstack.cpp | 6 +++++- tools/designer/src/components/formeditor/formwindow_widgetstack.h | 3 +-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/designer/src/components/formeditor/formwindow_widgetstack.cpp b/tools/designer/src/components/formeditor/formwindow_widgetstack.cpp index 7270628..58127b0 100644 --- a/tools/designer/src/components/formeditor/formwindow_widgetstack.cpp +++ b/tools/designer/src/components/formeditor/formwindow_widgetstack.cpp @@ -57,16 +57,20 @@ using namespace qdesigner_internal; FormWindowWidgetStack::FormWindowWidgetStack(QObject *parent) : QObject(parent), m_formContainer(new QWidget), - m_formContainerLayout(new QVBoxLayout), + m_formContainerLayout(new QStackedLayout), m_layout(new QStackedLayout) { m_layout->setMargin(0); m_layout->setSpacing(0); m_layout->setStackingMode(QStackedLayout::StackAll); + // We choose a QStackedLayout as immediate layout for + // the form windows as it ignores the sizePolicy of + // its child (for example, Fixed would cause undesired side effects). m_formContainerLayout->setMargin(0); m_formContainer->setObjectName(QLatin1String("formContainer")); m_formContainer->setLayout(m_formContainerLayout); + m_formContainerLayout->setStackingMode(QStackedLayout::StackAll); // System settings might have different background colors, autofill them // (affects for example mainwindow status bars) m_formContainer->setAutoFillBackground(true); diff --git a/tools/designer/src/components/formeditor/formwindow_widgetstack.h b/tools/designer/src/components/formeditor/formwindow_widgetstack.h index 92323c5..f21c4f0 100644 --- a/tools/designer/src/components/formeditor/formwindow_widgetstack.h +++ b/tools/designer/src/components/formeditor/formwindow_widgetstack.h @@ -51,7 +51,6 @@ QT_BEGIN_NAMESPACE class QDesignerFormWindowToolInterface; class QStackedLayout; -class QVBoxLayout; class QWidget; namespace qdesigner_internal { @@ -92,7 +91,7 @@ protected: private: QList m_tools; QWidget *m_formContainer; - QVBoxLayout *m_formContainerLayout; + QStackedLayout *m_formContainerLayout; QStackedLayout *m_layout; }; -- cgit v0.12