summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qdockarealayout.cpp
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-10-29 09:39:16 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-10-29 09:40:22 (GMT)
commit00908877d47c72e178cb0cee643229e3f3e1c64e (patch)
treef68a5da63d5dd55bfeeea99c71a4303d73e5c995 /src/gui/widgets/qdockarealayout.cpp
parent25502811723a026a38c0a861a6a304d24b8e6a95 (diff)
downloadQt-00908877d47c72e178cb0cee643229e3f3e1c64e.zip
Qt-00908877d47c72e178cb0cee643229e3f3e1c64e.tar.gz
Qt-00908877d47c72e178cb0cee643229e3f3e1c64e.tar.bz2
Fix autotest for QMainWindow
Diffstat (limited to 'src/gui/widgets/qdockarealayout.cpp')
-rw-r--r--src/gui/widgets/qdockarealayout.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gui/widgets/qdockarealayout.cpp b/src/gui/widgets/qdockarealayout.cpp
index df131ee..6895e09 100644
--- a/src/gui/widgets/qdockarealayout.cpp
+++ b/src/gui/widgets/qdockarealayout.cpp
@@ -2259,7 +2259,7 @@ QRect QDockAreaLayoutInfo::tabContentRect() const
** QDockAreaLayout
*/
-QDockAreaLayout::QDockAreaLayout(QMainWindow *win) : have_central(false)
+QDockAreaLayout::QDockAreaLayout(QMainWindow *win) : fallbackToSizeHints(true)
{
mainWindow = win;
sep = win->style()->pixelMetric(QStyle::PM_DockWidgetSeparatorExtent, 0, win);
@@ -2346,6 +2346,9 @@ bool QDockAreaLayout::restoreState(QDataStream &stream, const QList<QDockWidget*
for (int i = 0; i < 4; ++i)
corners[i] = static_cast<Qt::DockWidgetArea>(cornerData[i]);
}
+
+ if (!testing)
+ fallbackToSizeHints = false;
}
return ok;
@@ -2582,9 +2585,7 @@ void QDockAreaLayout::getGrid(QVector<QLayoutStruct> *_ver_struct_list,
{
QSize center_hint(0, 0);
QSize center_min(0, 0);
- const bool old_have_central = have_central;
- have_central = centralWidgetItem != 0 && !centralWidgetItem->isEmpty();
- const bool fallbackToSizeHints = !old_have_central && have_central;
+ const bool have_central = centralWidgetItem != 0 && !centralWidgetItem->isEmpty();
if (have_central) {
center_hint = centralWidgetRect.size();
if (!center_hint.isValid())
@@ -2630,6 +2631,8 @@ void QDockAreaLayout::getGrid(QVector<QLayoutStruct> *_ver_struct_list,
QSize bottom_max = docks[QInternal::BottomDock].maximumSize();
bottom_hint = bottom_hint.boundedTo(bottom_max).expandedTo(bottom_min);
+ fallbackToSizeHints = !have_central;
+
if (_ver_struct_list != 0) {
QVector<QLayoutStruct> &ver_struct_list = *_ver_struct_list;
ver_struct_list.resize(3);