void MainWindow::writeSettings()
{
QSettings settings;
settings.setPath("software-inc.com", "Spreadsheet");
settings.beginGroup("/Spreadsheet");
settings.writeEntry("/geometry/x", x());
settings.writeEntry("/geometry/y", y());
settings.writeEntry("/geometry/width", width());
settings.writeEntry("/geometry/height", height());
settings.writeEntry("/recentFiles", recentFiles);
settings.writeEntry("/showGrid", showGridAct->isOn());
settings.writeEntry("/autoRecalc", showGridAct->isOn());
settings.endGroup();
}
void MainWindow::readSettings()
{
QSettings settings;
settings.setPath("software-inc.com", "Spreadsheet");
settings.beginGroup("/Spreadsheet");
int x = settings.readNumEntry("/geometry/x", 200);
int y = settings.readNumEntry("/geometry/y", 200);
int w = settings.readNumEntry("/geometry/width", 400);
int h = settings.readNumEntry("/geometry/height", 400);
move(x, y);
resize(w, h);
recentFiles = settings.readListEntry("/recentFiles");
updateRecentFileItems();
showGridAct->setOn(
settings.readBoolEntry("/showGrid", true));
autoRecalcAct->setOn(
settings.readBoolEntry("/autoRecalc", true));
settings.endGroup();
}
|