Hello Is there any easy way to open the qt dialogs in the same position as they were the last time the application was open ? i.e preserve position of dialogs between application sessions ? Under easy way I understand not to have manually write the window position in file ,and then read :) Thanks
+6
A:
You can use the QSettings class to achieve this. It's an abstraction class that allow your applications to store its settings in order to retrieve them at next launch.
Save settings:
QSettings settings("ValueName", "Value");
Read settings:
QString v = settings.value("ValueName");
Patrice Bernassola
2009-10-08 15:23:35
There is even an example of how to do this in the Qt documentation, at http://doc.trolltech.com/4.5/qsettings.html#restoring-the-state-of-a-gui-application
gnud
2009-10-08 15:30:38
Yes it is on the same page that the QSettings class representation
Patrice Bernassola
2009-10-08 15:33:37
+2
A:
Use QSettings along with QWidget::restoreGeometry() and QWidget::saveGeometry().
larsm
2009-10-09 12:41:53