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.
            Asked
            
        
        
            Active
            
        
            Viewed 2.4k times
        
    4 Answers
26
            
            
        You need no Additional code except QT itself to parse JSON with QT
        jesterjunk
        
- 2,342
 - 22
 - 18
 
        ALoopingIcon
        
- 2,218
 - 1
 - 21
 - 30
 
- 
                    12This 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
 - 
                    3Joey, 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
 
- 
                    1There is now a bunch of differences, such that *exactly* no longer applies. – tshepang Nov 01 '12 at 13:09
 - 
                    
 - 
                    1
 
16
            
            
        
        Dirk Eddelbuettel
        
- 360,940
 - 56
 - 644
 - 725
 
- 
                    7qjson 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