Skip to content

Instantly share code, notes, and snippets.

@nowrep
Created February 12, 2012 20:11
Show Gist options
  • Save nowrep/1810670 to your computer and use it in GitHub Desktop.
Save nowrep/1810670 to your computer and use it in GitHub Desktop.
Iterate through all groups and keys in QSettings
QString allGroupsString;
QSettings* settings = Settings::globalObject();
foreach (const QString &group, settings->childGroups()) {
QString groupString = QString("<table><th>..%1..</th>").arg(group);
settings->beginGroup(group);
foreach (const QString &key, settings->childKeys()) {
groupString.append(QString("<tr><td>%1</td><td>%2</td></tr>").arg(key, settings->value(key).toString()));
}
settings->endGroup();
groupString.append("</table>");
allGroupsString.append(groupString);
}
// allGroupsString now should contain all groups in table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment