24

I'm using QT for Symbian and need a simple json parser. I need to be able to go from json to Qt-variant and the other way around. Is there a simple json parser that I can use? I don't want to write my own.

tshepang
  • 12,111
  • 21
  • 91
  • 136
Martin
  • 1,675
  • 11
  • 34
  • 46

4 Answers4

26

You need no Additional code except QT itself to parse JSON with QT

http://doc.qt.io/qt-5/json.html

jesterjunk
  • 2,342
  • 22
  • 18
ALoopingIcon
  • 2,218
  • 1
  • 21
  • 30
  • 12
    This is really evaluating JavaScript, which may not be ideal from either a performance or security point of view. – Matthew Flaschen Nov 12 '10 at 23:42
  • Matthew: The JSON RFC includes a simple regex-based check at the end to determine whether JSON is safe for evaluation by a JavaScript engine. – Joey Apr 26 '12 at 10:53
  • 3
    Joey, it does, but for mobile app loading the javascript engine is undesirable. – Prakash Nadar May 15 '12 at 00:28
20

Check out Qt-Json

Its a dead-simple class for parsing and serializing JSON data.

Gerstmann
  • 5,368
  • 6
  • 37
  • 57
16

The qjson project may be a good start. It has also been packaged for Debian.

Dirk Eddelbuettel
  • 360,940
  • 56
  • 644
  • 725
  • 7
    qjson is the kind of heavy weight library that I avoid at all cost in my projects. It needs to be built and installed separately for each system and forces you to distribute a new DLL with your executable. Depending on your needs, it's much better to use the buit-in way proposed by ALoopingIcon, or Eelis's QJson class, which is great too (http://ereilin.tumblr.com/post/6857765046/json-parser-class-for-qt). – laurent Jul 30 '11 at 12:49
0

I wrote a QLALR based JSON parser : http://git.forwardbias.in/?p=qjsonparser.git.

git clone git://git.forwardbias.in/qjsonparser.git.

Girish
  • 1
  • 2