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

Alex Malyushytskyy alexmalvtk at gmail.com
Thu Mar 21 01:59:14 CET 2013


It is supposed to be no difference when restore state as soon as all
children (toolbars, etc) are created already.
Also if you are using QSettings to save/load state make sure you
already set atributes to QSettings so it is written/read from the same
location.

Regards,
     Alex

On Wed, Mar 20, 2013 at 9:14 AM, Scott Aron Bloom
<scott.bloom at onshorecs.com> wrote:
> Post some code showing where you are using it in the constructor…
>
>
>
> I use it in mine and it works fine.
>
>
>
> From: interest-bounces+scott.bloom=onshorecs.com at qt-project.org
> [mailto:interest-bounces+scott.bloom=onshorecs.com at qt-project.org] On Behalf
> Of Etienne Sandré-Chardonnal
> Sent: Wednesday, March 20, 2013 6:05 AM
> To: Interest at qt-project.org
> Subject: [Interest] QMainWindow::restoreState : where to call it?
>
>
>
> 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!
>
> What is the best way to use it? The documentation is lacking a clear example
> (or I did not find it)
>
> Thanks!
>
> Etienne
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>



More information about the Interest mailing list