[Interest] QMainWindow::restoreState : where to call it?

Bill Crocker william.crocker at analog.com
Wed Mar 20 15:09:39 CET 2013


On 03/20/2013 09:05 AM, Etienne Sandré-Chardonnal wrote:
> Dear all,
>
> I want to use QMainWindow::restoreState for restoring window dock widgets.
> saveState works well in closeEvent (I have some data in the registry wrote with
> QSettings).
>
> restoreState does not work when called from the constructor (nothing is restored)
> I have googled for this, most people put it in showEvent. But showEvent is
> called also when the window gets restored after being minimized, the docks
> should not be restored then!
>

Use a boolean to only restore on the first call to showEvent ?

> What is the best way to use it? The documentation is lacking a clear example (or
> I did not find it)
>
> Thanks!
>
> Etienne





More information about the Interest mailing list