赞
踩
const QString APP_CONFIG_PATH=QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation);
- QString CommonAPI::readIni(const QString &fileName,const QString &key)
- {
- QString value;
- QString filePath=APP_CONFIG_PATH+"/"+fileName;
- QFile file(filePath);
- if(file.exists())
- {
- QSettings *configIniRead = new QSettings(filePath, QSettings::IniFormat);
- if (configIniRead)
- {
- value = configIniRead->value(key).toString();
- delete configIniRead;
- configIniRead = nullptr;
- }
- }
- return value;
- }
- void CommonAPI::writeIni(const QString &fileName,const QString &key,const QString &value)
- {
- if(!createDir(APP_CONFIG_PATH))
- {
- return;
- }
- QString filePath=APP_CONFIG_PATH+"/"+fileName;
- QSettings *configIniWrite = new QSettings(filePath, QSettings::In
赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。