forked from qt-creator/qt-creator
Debugger: Try harder to restore dock widget sizes
This is bit of a hack: The dock widget sizes were actually restored but when previously non-existing docks were affected, a re-layout was triggered, resulting in different sizes. This can be avoided by instantiating all dock first. Fixes: QTCREATORBUG-22415 Change-Id: I4c0b27f5bab5864e93e303db758d8b909a51a425 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -940,12 +940,10 @@ void PerspectivePrivate::restoreLayout()
|
||||
qCDebug(perspectivesLog) << "PERSPECTIVE STATE AVAILABLE BY FULL ID.";
|
||||
}
|
||||
|
||||
if (state.isEmpty()) {
|
||||
qCDebug(perspectivesLog) << "PERSPECTIVE " << m_id << "RESTORE NOT POSSIBLE, NO STORED STATE";
|
||||
} else {
|
||||
bool result = theMainWindow->restoreState(state);
|
||||
qCDebug(perspectivesLog) << "PERSPECTIVE " << m_id << "RESTORED. SUCCESS: " << result;
|
||||
}
|
||||
// The order is important here: While QMainWindow can restore layouts with
|
||||
// not-existing docks (some placeholders are used internally), later
|
||||
// replacements with restoreDockWidget(dock) trigger a re-layout, resulting
|
||||
// in different sizes. So make sure all docks exist first before restoring state.
|
||||
|
||||
qCDebug(perspectivesLog) << "PERSPECTIVE" << m_id << "RESTORING LAYOUT FROM " << settingsId();
|
||||
for (DockOperation &op : m_dockOperations) {
|
||||
@@ -958,6 +956,13 @@ void PerspectivePrivate::restoreLayout()
|
||||
<< (active == op.visibleByDefault ? "DEFAULT USER" : "*** NON-DEFAULT USER");
|
||||
}
|
||||
}
|
||||
|
||||
if (state.isEmpty()) {
|
||||
qCDebug(perspectivesLog) << "PERSPECTIVE " << m_id << "RESTORE NOT POSSIBLE, NO STORED STATE";
|
||||
} else {
|
||||
bool result = theMainWindow->restoreState(state);
|
||||
qCDebug(perspectivesLog) << "PERSPECTIVE " << m_id << "RESTORED, SUCCESS: " << result;
|
||||
}
|
||||
}
|
||||
|
||||
void PerspectivePrivate::saveLayout()
|
||||
|
Reference in New Issue
Block a user