Questions tagged [qjson]

QJson is a qt-based library that maps JSON data to QVariant objects: JSON arrays will be mapped to QVariantList instances, while JSON objects will be mapped to QVariantMap.

QJson is a small and easy-to-use library. Converting a JSON object is as simple as this:

// create a JSonDriver instance
QJson::Parser parser;
bool ok;

// json is a QString containing the data to convert
QVariant result = parser.parse (json, &ok);

Official page | API documentation

85 questions
1
vote
1 answer

error: C1083: Cannot open include file: 'QJson/Parser': No such file or directory

I am getting this error when i am trying to run my Qt project downloaded from this link https://code.google.com/p/qml-google-maps/downloads/list I'm trying to compile it in Qt 5.0.2. error: C1083: Cannot open include file: 'QJson/Parser': No such…
Rsvay
  • 1,285
  • 2
  • 13
  • 36
1
vote
1 answer

Compile QJson on Windows with MinGW

I'm trying to compile QJson library for my Qt project and run it on Windows. I've downloaded zip from GitHub and follow this instructions on project website: created build folder cmake -G "MinGW Makefiles" .. mingw32-make and got next error: If I…
Viktor K
  • 2,153
  • 3
  • 25
  • 40
1
vote
1 answer

CMake: How to generate different shared library names depending on build type

This is my first time using CMake and I'm trying to build QJSon, a JSON parser for Qt 4.x. What I want basically is to build different output library names depending on the build configuration. I'm using ${CMAKE_BUILD_TYPE} macro to generate…
Hernán
  • 4,527
  • 2
  • 32
  • 47
1
vote
2 answers

Qt 5.0 Json encoding

Im using qt 5.0 and its support such classes as QJsonObject QJsonDocument and QJsonArray. In my programm i need to serialize json array and convert it to qstring/qbytearray but i didn't found any serialize or encode methods in those classes. Is…
SirLanceloaaat
  • 213
  • 9
  • 18
1
vote
1 answer

Use qjson in my Qt symbain app

I'm using Qt to develop a Symbian app. I downloaded qjson from the link. I followed the instructions in that link and yes, I have the qjson.sis file. Now I need to use it in my app. When I tried, I got this error. Launch failed: Command answer…
Joshua
  • 27
  • 2
  • 7
1
vote
1 answer

Getting error while passing a QString object to Parser::parse()

I am reading a JSON file using Qfile. Storing it in to a Qstring object. While passing the QString object to Parser::parse(), it is showing the compilation error as The function parse() only accepts QIODevice* or const QByteArray& as first…
1
vote
1 answer

Installing QJson on Windows

Now I'm porting my project from Linux to Windows. I've built QJson using QtCreator by instructions, and now I have one simple question: where I should move the library dll-file, and what I should specify in LIBS += line in the .pro file? Here's…
Ivan Akulov
  • 4,323
  • 5
  • 37
  • 64
0
votes
1 answer

use of qjson library

When I try to use QJson library application cannot even start. I get message path\app.exe exited with code 128. I include QJson in app.pro as followsLIBS += qjson/lib/qjson0.dll QJson is in my project directory and I includ eserializer.h #include…
krltos
  • 313
  • 4
  • 20
0
votes
1 answer

Flatten multidimensional nested Qt Json structure like QJsonValue / QJsonObject / QJsonArray

Seeking a way of flattening a multidimensional nested QJsonValue containing all 6 basic data types (object, array, bool, double, String, Null). Simple example for the purpose of understanding...Input: { "date": 1681693886, "online": true, …
marc
  • 1,207
  • 11
  • 16
0
votes
1 answer

How to convert from QString to JSON in C++ side

In qml, templist: [{"product_code":"111111111","product_name":"AAAA"}, {"product_code":"222222222","product_name":"BBBB"}, {"product_code":"33333333","product_name":"CCCC"}] with the help of below code in the qml side, the above templist sent to…
0
votes
1 answer

Indexing unnamed QJsonDocument in Qt < 5.10

Given unnamed JSON document: [ { }, { }, ] Qt 5.10+ has operator[] for QJsonDocument, so we can address any of them by index: json_doc[1]; How does one do the same in older versions of Qt?
Amanda Helgström
  • 115
  • 1
  • 1
  • 8
0
votes
2 answers

QVariantMap crash in destructor

I am building a JSON-object with Qt and convert it to a QString using QJson. This (normally) works fine and it does in this case but in the destructor of my Qt data structure, it crashes with an Access Violation. The Object is built fine, it is sent…
Tobias
  • 737
  • 1
  • 9
  • 20
0
votes
1 answer

Update value in QJsonArray and write back to Json file in Qt

I have a Json file to read and display on UI. Reading is fine but when I tried to update value wheelbase, code runs with no errors but it does not update the Json Json file example { "$type": "SystemList", "$values": [ { …
Neung Chung
  • 159
  • 1
  • 1
  • 10
0
votes
1 answer

Convert QTextCharFormat to QJsonValue

I have to convert a QTextCharFormat to a QJsonValue because it has to be transmitted from a client to a server in a Json message, but I have no idea how to do it. Can anyone help me out?
0
votes
1 answer

How to parse this JSON file? (Qt)

Im using Qt5.7.1 and trying to read information in my JSON file. The structure of my file includes: the name of the configuration, the number of neurons, an array of neurons (each neuron has a strict number of receptors and synapses, which are also…