-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Broken restoration of nested MainWindow
#508
Comments
To be easy to build and test. This will be deleted after the issue is fixed.
Reproduced visibility problem |
The code to deserialize the QWindow should only run for the top-level QMainWindow, not the nested ones. Fixes issue #508
The code to deserialize the QWindow should only run for the top-level QMainWindow, not the nested ones. Fixes issue #508
Visibility bug is fixed and tested. The geometry bug I can't reproduce with 1 screen, but I fixed some geometry bugs as well (same root cause as the visibility stuff). please reopen if not The fix is in latest main branch |
Did you test with the mwe from above? |
We had fixed it only for the case where the dockwidget is direct parent of the mainwindow, but it can happen that the dockwidget is further up the hierarchy. Fixes issue #508
I had a trimmed down version of the MWE so couldn't repro anymore. |
The visibility bug seems to be fixed now. The geometry bug is a bit confusing... I cannot reproduce any problems with Qt5.15.8.
The window is restored maximized on the screen, where it appeared initially. |
I'll have access to a 2nd screen next week |
To be easy to build and test. This will be deleted after the issue is fixed.
I've reproduced it, but it's unrelated to main window nesting. Debugging it now, very curious about this one :) |
I experienced some issues with the restoration of nested
MainWindow
s.The problem is, that during restoration, the properties of
MainWindow
s are applied to the corresponding root views, which means, that an embeddedMainWindow
s properties are forwarded to the embedding window, possibly overwriting the properties of the latter.I have two specific cases where this causes problems, use the mwe below to reproduce them.
In the mwe I setup one
MainWindow
, which has twoDockWidgets
docked (SuperDock-1, SuperDock-2). Each of this "SuperDock" contains again aMainWindow
. Both of thoseMainWindow
s has a dockedDockWidget
(SubDock-A (1), SubDock-B (2)).Case 1 (visibility)
If you stack SuperDock-2 behind SuperDock-1 and then save and restore the layout (use the actions in the File menu), the application
MainWindow
disappears. You can run this actions by enabling theif (0) ...
at the bottom of the mwe code.This happens because the SuperDock-2 is restored at last and since it's hidden, its
visibility
property isfalse
. As explained above, this is applied to the root view, which is the applicationMainWindow
, which the is set invisible.Case 2 (geometry)
Here you need at least two screens. Run the mwe, maximize the window on the right screen and then save and restore the layout. The window will appear on the left screen.
In this case the property
normalGeometry
of the Sub-Docks, which has something likex=9
in my case, instead ofx=1920
for the applicationMainWindow
, is applied to the application window. This moves the window to the left screen.Just in case, I attach the saved layout
.json
(mylayout.json), where I got the numbers from. Note, that I have three screens.MWE
The text was updated successfully, but these errors were encountered: