QSettings的使用(写/读配置文件)

//
void gAppSetCurrentVersionUpdate(bool autoUpdate)
{
    QSettings settings(
        QSettings::IniFormat, 
        QSettings::UserScope,
        QCoreApplication::organizationName(),
        QCoreApplication::applicationName());

    settings.setValue("VersionUpdateInformation", autoUpdate);
}
//
bool gAppLoadCurrentVersionUpdateState()
{
    QSettings settings(
        QSettings::IniFormat, 
        QSettings::UserScope,
        QCoreApplication::organizationName(),
        QCoreApplication::applicationName());

    bool autoUpdate = settings.value("VersionUpdateInformation", true).toBool();

    return autoUpdate;
}

 

posted @ 2014-10-18 14:05  纠纠结结  阅读(831)  评论(0编辑  收藏  举报