标签:
QString appDirPath = QCoreApplication::applicationDirPath();
QSettings* configIniRead = new QSettings(appDirPath+"/setup.ini", QSettings::IniFormat);
// test
/*
configIniRead->beginGroup("mainwindow");
configIniRead->setValue("size", 122);
configIniRead->setValue("fullScreen", 1);
configIniRead->endGroup();
configIniRead->beginGroup("outputpanel");
configIniRead->setValue("visible", 1);
configIniRead->endGroup();
settings.setValue("fridge/color", QColor(Qt::white));
settings.setValue("fridge/size", QSize(32, 96));
settings.setValue("sofa", true);
settings.setValue("tv", false);
QStringList keys = settings.allKeys();
// keys: ["fridge/color", "fridge/size", "sofa", "tv"]
QStringList keys = settings.childKeys();
// keys: ["sofa", "tv"]
QStringList groups = settings.childGroups();
// groups: ["fridge"]
configIniRead->beginWriteArray("logins");
for (int i = 0; i < 3; ++i) {
configIniRead->setArrayIndex(i);
configIniRead->setValue("userName", i);
configIniRead->setValue("password", "0a");
}
configIniRead->endArray();
*/
标签:
原文地址:http://www.cnblogs.com/coolbear/p/5603165.html