You can read all group using QSettings::childGroups()
for example
Q_FOREACH (QString group, settings.
childGroups()) { settings.beginGroup(group);
foreach
(const QString &childKey, childKeys
) {
Keys << childKey;
values << settings.value(childKey).toString();
}
settings.endGroup();
}
QSettings settings(QDir::currentPath() + "/test.ini", QSettings::IniFormat);
Q_FOREACH (QString group, settings.childGroups()) {
settings.beginGroup(group);
const QStringList childKeys = settings.childKeys();
QStringList Keys;
QStringList values;
foreach (const QString &childKey, childKeys)
{
Keys << childKey;
values << settings.value(childKey).toString();
}
settings.endGroup();
}
To copy to clipboard, switch view to plain text mode
or, if you read ONLY "sys_*" groups
Q_FOREACH (QString group, settings.
childGroups()) { if (!group.startsWith("sys_"))
continue;
settings.beginGroup(group);
foreach
(const QString &childKey, childKeys
) {
Keys << childKey;
values << settings.value(childKey).toString();
}
settings.endGroup();
}
QSettings settings(QDir::currentPath() + "/test.ini", QSettings::IniFormat);
Q_FOREACH (QString group, settings.childGroups()) {
if (!group.startsWith("sys_"))
continue;
settings.beginGroup(group);
const QStringList childKeys = settings.childKeys();
QStringList Keys;
QStringList values;
foreach (const QString &childKey, childKeys)
{
Keys << childKey;
values << settings.value(childKey).toString();
}
settings.endGroup();
}
To copy to clipboard, switch view to plain text mode
Bookmarks