qt - QMainWindow.saveState() / .restoreState() handle central widget incorrectly -


i'm struggling qmainwindow , qdockwidgets, seems messy area.

i need simple thing: when application closed, arrangement of dockwidgets should saved, , when application opened, arrangement should restored.

the problem savestate()/restorestate() methods deal strangely central widget. there several variants, , each has own problems:

1. central widget set to, say, qplaintextedit or qlabel

when state restored, dockwidgets occupy horizontal space possible, thin central widget in middle of left , right dockwidgets. size , position of central widget kept vertically, horizontal boundaries between dockwidgets , central widget not saved.

2. central widget set null

if explicitly call:

this->setcentralwidget(null); 

then statesave()/staterestore() work: state saved , restored correctly, strange reason user unable dock widgets @ top or bottom. widgets can docked in 1 horizontal row, no matter how hard try dock @ top or bottom.

3. no central widget

by "no central widget" mean not touching central widget @ all. reason, behavior different comparing null central widget:

state saved , restored correctly, if make window small, , expand again, dockwidgets remain small huge unused area in middle. so, user have resize them manually.


all of looks strange. i'll have go "no central widget" variant, i'm confused because don't understand behavior, maybe it's bug, , then, behavior may change in future versions.

so, each of these ways has own problems. if can give me clue on solving of them, i'd glad.


Comments

Popular posts from this blog

php - Zend Framework / Skeleton-Application / Composer install issue -

c# - Better 64-bit byte array hash -

python - PyCharm Type error Message -