Advertisement
masbog

Sample JSON Parse BB10 Cascade Native QT

Jul 18th, 2012
452
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. void App::replyFinished(QNetworkReply* reply)
  2. {
  3. qDebug() << "Got into replyFinished";
  4.  
  5. if (reply->error() == QNetworkReply::NoError)
  6. {
  7. QByteArray result = reply->readAll();
  8. QScriptValue sc;
  9. QScriptEngine engine;
  10. sc = engine.evaluate("(" + QString(result) + ")");
  11.  
  12. if (sc.property("root").property("children").isArray())
  13. {
  14. QScriptValueIterator it(sc.property("data").property("children"));
  15. while (it.hasNext()) {
  16. it.next();
  17.  
  18. qDebug("Name %s", it.name().toStdString().c_str());
  19. }
  20. }
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement