Created
February 12, 2012 20:11
-
-
Save nowrep/1810670 to your computer and use it in GitHub Desktop.
Iterate through all groups and keys in QSettings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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