vratojr
10th March 2006, 13:37
Hello,
I have a mw with 2 dockwidget that I'd like to restore at start.
Here is the code I use:
dockInfo = new DockWindow(widgetInfo->windowTitle());
addDockWidget(Qt::TopDockWidgetArea,dockInfo);
dockInfo->setWidget(widgetInfo);
dockInfo->hide();
dockScancella = new DockWindow(widgetScancella->windowTitle());
addDockWidget(Qt::BottomDockWidgetArea,dockScancel la);
dockScancella->setWidget(widgetScancella);
dockScancella->hide();
restoreState(stato);
and,during the closeEvent function I save the state of the window using
stato=saveState();
and write it to file.
Well, if I use 1 of the 2 dock widget (I mean I comment the code regarding the other) I have no problem and I can restore the whole system.
If I use both the widgets, the bytearray representing the savingstate becomes more and more larger at each time I save the state. Moreover the widgets are nore restored correctly (they are restored randomly) in particular,sometimes, one of the 2 appears to be multiplied on screen and each copy is flickering.
any hints?
Thanks!
I have a mw with 2 dockwidget that I'd like to restore at start.
Here is the code I use:
dockInfo = new DockWindow(widgetInfo->windowTitle());
addDockWidget(Qt::TopDockWidgetArea,dockInfo);
dockInfo->setWidget(widgetInfo);
dockInfo->hide();
dockScancella = new DockWindow(widgetScancella->windowTitle());
addDockWidget(Qt::BottomDockWidgetArea,dockScancel la);
dockScancella->setWidget(widgetScancella);
dockScancella->hide();
restoreState(stato);
and,during the closeEvent function I save the state of the window using
stato=saveState();
and write it to file.
Well, if I use 1 of the 2 dock widget (I mean I comment the code regarding the other) I have no problem and I can restore the whole system.
If I use both the widgets, the bytearray representing the savingstate becomes more and more larger at each time I save the state. Moreover the widgets are nore restored correctly (they are restored randomly) in particular,sometimes, one of the 2 appears to be multiplied on screen and each copy is flickering.
any hints?
Thanks!