qt 读写ini文件

#include 
 //写配置文件
    QSettings m_settings("Config.ini", QSettings::IniFormat);
    m_settings.beginGroup("vol");
    m_settings.setValue("reference",  res_ch1);
    m_settings.setValue("reference1", res_ch2);
    m_settings.setValue("reference2", res_ch3);
    m_settings.setValue("reference3", res_ch4);
    m_settings.endGroup();

//读配置文件
    QSettings m_psetting("Config.ini", QSettings::IniFormat);
    m_psetting.beginGroup("vol");
    float Inter_vol = m_psetting.value("reference").toFloat();
    m_psetting.endGroup();

 

你可能感兴趣的:(qt)