QT读取ini配置文件(QSettings)

ini配置文件(smart.ini)格式:


[common]

workbench=c:\\work\\2.1


头文件:

#include <QString>  
#include <QSettings>

示例代码:


QString sIniFilePath   = m_sDir+"common\\config\\smart.ini";
QSettings *sIniSetting = new QSettings(sIniFilePath, QSettings::IniFormat);
sIniSetting->setIniCodec("UTF-8");
QString sWorkbenchPath = sIniSetting->value("common/workbench",QString("NULL")).toString();


你可能感兴趣的:(c,null,ini,qt)