I am reading in a JSON file that looks like this: { "capData": { "host": "foo.bar.com", "initial_port": "8000" "secondary_port": "8001" }, "django": { "host": "baz.bar.com", "port": "8004" } }
I want to iterate through it and put the data in some structure that I can access like this: d['capData'].host d['django'].port I've see a lot of code that does something like this: QJsonDocument document = QJsonDocument::fromJson(jsonData); QJsonObject object = document.object(); QJsonValue value = object.value("capData"); But I don't want to hard code the keys - I want to pick up and store whatever happens to be in the JSON file. How can I iterate through it and do that? Also, what would be the best object to store this in so I can later access it as I want to? _______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest