ProjectExplorer: Fix project window layout restore behavior

Steps to trigger the problem:
1) Start Creator with some fresh settings path.
2) Open an unconfigured project.
3) Observe a normal-looking target setup page.
4) Configure the project.
5) Close the project.
6) Remove the .user file.
7) Re-open the project.
8) Observe a target setup page whose left part takes up almost all the
   space, leaving the main project widget practically invisible.

Conclusion: The configure page does something to the widget state that
breaks the restored layout. I don't know what it is exactly.

Fix: Slightly delay restoring the widget layout.

Change-Id: Id88ea12267a7dd0fe54749c18b0761d0e873d646
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2020-10-29 17:47:59 +01:00
parent 18bd2314fb
commit 247a432f74

View File

@@ -669,8 +669,10 @@ void ProjectWindow::hideEvent(QHideEvent *event)
void ProjectWindow::showEvent(QShowEvent *event)
{
loadPersistentSettings();
FancyMainWindow::showEvent(event);
// Delay appears to be necessary for the target setup page to have the correct layout.
QTimer::singleShot(0, this, &ProjectWindow::loadPersistentSettings);
}
ProjectWindow::~ProjectWindow() = default;