5void MyMainWindow::closeEvent(QCloseEvent *event)
7 QSettings settings(
"MyCompany",
"MyApp");
8 settings.setValue(
"geometry", saveGeometry());
9 settings.setValue(
"windowState", saveState());
10 QMainWindow::closeEvent(event);
16void MainWindow::readSettings()
18 QSettings settings(
"MyCompany",
"MyApp");
19 restoreGeometry(settings.value(
"myWidget/geometry").toByteArray());
20 restoreState(settings.value(
"myWidget/windowState").toByteArray());