Сохранить настройки
C++ (Qt)
void FormMain::saveSettings()
{
QString inifile = QApplication::applicationDirPath() + "/" + "mpsqt.ini";
QSettings settings(inifile, QSettings::IniFormat);
settings.beginGroup("MainForm");
settings.setValue("size", size());
settings.setValue("pos", pos());
settings.setValue("lastpath", lastPath);
settings.endGroup();
}
Востановить настройки
C++ (Qt)
void FormMain::restoreSettings()
{
QString inifile = QApplication::applicationDirPath() + "/" + "mpsqt.ini";
QSettings settings(inifile, QSettings::IniFormat);
settings.beginGroup("MainForm");
resize(settings.value("size", QSize(400, 280)).toSize());
move(settings.value("pos", QPoint(200, 200)).toPoint());
lastPath = settings.value("lastpath", "").toString();
settings.endGroup();
}