summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2010-03-08 13:07:32 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2010-03-08 13:09:06 (GMT)
commit41437f55f911b32d17ed153a14eb1b1673f17c86 (patch)
tree77caf8f24e916128605add588a70320ea18e5dd1 /src/gui
parentff9f3fc24c57254b150c1afba2e5883da8ed2b83 (diff)
downloadQt-41437f55f911b32d17ed153a14eb1b1673f17c86.zip
Qt-41437f55f911b32d17ed153a14eb1b1673f17c86.tar.gz
Qt-41437f55f911b32d17ed153a14eb1b1673f17c86.tar.bz2
Fix undocked widgets not being restored correctly as part of the layout
Task-number: QTBUG-7921 Reviewed-by: ogoffart
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/widgets/qdockarealayout.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/gui/widgets/qdockarealayout.cpp b/src/gui/widgets/qdockarealayout.cpp
index 0c39f42..794863b 100644
--- a/src/gui/widgets/qdockarealayout.cpp
+++ b/src/gui/widgets/qdockarealayout.cpp
@@ -1990,16 +1990,19 @@ bool QDockAreaLayoutInfo::restoreState(QDataStream &stream, QList<QDockWidget*>
#ifdef QT_NO_TABBAR
const int tabBarShape = 0;
#endif
- QDockAreaLayoutInfo *info = new QDockAreaLayoutInfo(sep, dockPos, o,
- tabBarShape, mainWindow);
- QDockAreaLayoutItem item(info);
+ QDockAreaLayoutItem item(new QDockAreaLayoutInfo(sep, dockPos, o,
+ tabBarShape, mainWindow));
stream >> item.pos >> item.size >> dummy >> dummy;
- if (!info->restoreState(stream, widgets, testing))
+ //we need to make sure the element is in the list so the dock widget can eventually be docked correctly
+ if (!testing)
+ item_list.append(item);
+
+ //here we need to make sure we change the item in the item_list
+ QDockAreaLayoutItem &lastItem = testing ? item : item_list.last();
+
+ if (!lastItem.subinfo->restoreState(stream, widgets, testing))
return false;
- if (!testing) {
- item_list.append(item);
- }
} else {
return false;
}