QString ReadSettings(const QString& filepath, const QString& groupname, const QString& key)
{
QString ret;
QSettings* setting = new QSettings(filepath, QSettings ::IniFormat);
setting->beginGroup(groupname);
ret = setting->value(key).toString();
setting->endGroup();
return ret;
}
void WriteSettings(const QString& filepath, const QString& groupname,
const QString& key, const QString& value, bool issync)
{
QSettings* setting = new QSettings(filepath, QSettings ::IniFormat);
setting->beginGroup(groupname);
setting->setValue(key, value);
setting->endGroup();
if (issync)
setting->sync();
}