QSettings::IniFormat values with “,” returned as QStringList
问题 I am using QSettings to parse an ini file: QSettings cfg(path, QSettings::IniFormat); When I obtain a value QVariant qv = cfg.value("title"); containing a comma the variant contains a QStringList instead of a QString title=foo => QString title=foo,bar => QStringList How can I always get strings, or at least obtain the original line ( title=foo,bar ) ? 回答1: You have at least two ways to address this issue, all of them presented below: test.ini title="foo,bar" title_unquoted=foo,bar main.cpp