How to get the relationship between two QDockWidget?
-
wrote on 16 Aug 2011, 13:57 last edited by
Use "QMainWindow::saveState()":http://doc.trolltech.com/latest/qmainwindow.html#saveState and "QMainWindow::restoreState()":http://doc.trolltech.com/latest/qmainwindow.html#restoreState for that sorta thing.
-
wrote on 16 Aug 2011, 13:59 last edited by
[quote author="Franzk" date="1313503030"]Use "QMainWindow::saveState()":http://doc.trolltech.com/latest/qmainwindow.html#saveState and "QMainWindow::restoreState()":http://doc.trolltech.com/latest/qmainwindow.html#restoreState for that sorta thing.[/quote]
Indeed: that's why I asked :-)
-
wrote on 16 Aug 2011, 14:12 last edited by
I make a layout manager which can modify the achieved xml .This layout manager is for Users,Users can use manager layout QDockwidgets by their way. Then the application can layout QDockwidgets according the achieved xml.
-
wrote on 16 Aug 2011, 14:12 last edited by
QMainWindow::saveState() and restore function cant fit.
-
wrote on 16 Aug 2011, 14:16 last edited by
may be i have a bad english expression,i should study hard.
-
wrote on 16 Aug 2011, 14:28 last edited by
As far as I know, saveState()/restoreState() is the only way of accessing this. Why do you want to manage this from a layout manager when QMainWindow does it for you already?
-
wrote on 16 Aug 2011, 14:40 last edited by
now, i can save QToolBar,QMenu state and restore them well,but cant restore QDockwidget well only.
For different users or industry, i support application with different layout. -
wrote on 16 Aug 2011, 14:41 last edited by
If all else fails: the sources of Qt are available to you. Check how saveState() and restoreState() are implemented, and perhaps you'll find something you can use. You might need to use undocumented or even expose private functionality to pull it off that way. Perhaps even a modification of Qt itself is needed. If you implement that nicely, you could try to have that merged in as a patch (if you can give a good use case for it).
-
wrote on 16 Aug 2011, 15:06 last edited by
Good idea. Actually I have saw the saveState() and restoreState() source code for several times. It is based on too much Qt's private implemention. It use many classes(not api) which derived from QLayout to implement this.I will continue to study.
-
wrote on 16 Aug 2011, 15:09 last edited by
ok
-
wrote on 16 Aug 2011, 15:52 last edited by
Please use the edit option next to your post to make spelling corrections or additions instead of making new posts.
15/16