[Qt-interest] How to restore position of one dock?

Konstantin Tokarev annulen at yandex.ru
Sat Feb 27 17:37:52 CET 2010


> Here is how I do it for saving and writting settings.  The dock widget below is called consoleDock.
> 
> // readSettings on application start
>  QSettings settings;
>   QAction action = consoleDock->toggleViewAction();
>    if (action)  {
>     showMe = settings.value("ConsoleArea",true).toBool();
>     action->setChecked(showMe);
>     if (!showMe) 
>       consoleDock->hide();
>   }
> 
> 
> //write settings on application close
>  QSettings settings;
>  action = consoleDock->toggleViewAction();
>  settings.setValue("ConsoleArea",action->isChecked());
> 
> Like wise you can read/set setting values for where the DockWidget is placed.

Sorry, if I'm asking about something trivial, but I can't realize, what method should I use to save current area (not allowed areas!)  for some dock. Also, I'd like to save if dsome dock were tabbed or nested

-- 
Regards,
Konstantin



More information about the Qt-interest-old mailing list