QSettings简单使用

设置

QSettings settings("myconf.ini",QSettings::IniFormat);
settings.beginGroup("mainwindow");
settings.setValue("size", win->size());
settings.setValue("fullScreen", win->isFullScreen());
settings.endGroup();

settings.beginGroup("outputpanel");
settings.setValue("visible", panel->isVisible());
settings.endGroup();

使用之一

QSettings settings("myconf.ini",QSettings::IniFormat);
settings.beginGroup("outputpanel");
bool ok = settings.value("visible").toBool();
//do somethings
settings.endGroup();

你可能感兴趣的:(QT)