A simple C++/Qt library for parsing JSON data into QVariant hierarchies and serializing QVariant data to JSON.
qt-json is a simple C++ library for Qt that parses JSON data into QVariant hierarchies and serializes QVariant data back to JSON. It solves the problem of handling JSON in Qt4 applications, where native JSON support was lacking, by providing easy-to-use functions for data conversion.
Qt developers, particularly those using Qt4, who need to integrate JSON data parsing and serialization into their C++ applications without relying on external complex libraries.
Developers choose qt-json for its simplicity and direct integration with Qt's QVariant system, offering a lightweight alternative to Qt's native JSON support in Qt4 or a straightforward helper for specific use cases.
A simple class for parsing JSON data into a QVariant hierarchy and vice versa.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
The parse function converts JSON strings to QVariant maps or lists with a simple boolean error flag, making integration and debugging easy, as shown in the README example with nested access.
Supports both minified and pretty-printed JSON output via a global setPrettySerialize function, ideal for debugging or logging without code changes, demonstrated in the serialization section.
Offers objectBuilder and arrayBuilder for chainable, readable construction of complex JSON structures, reducing boilerplate code in examples like nested friend lists.
Designed specifically for Qt4 where JSON support was absent, providing an essential, lightweight tool for maintaining older Qt applications without external dependencies.
The README explicitly advises Qt5 users to use native classes, indicating limited updates and potential compatibility issues, making it redundant for newer projects.
The pretty-print setting is global (setPrettySerialize), which can cause unintended side-effects in multi-threaded applications or when different serialization styles are needed concurrently.
Lacks advanced JSON capabilities such as detailed error messaging, schema validation, or streaming support, limiting its use for complex or large-scale data handling.
Relies on QVariant conversions, which may introduce memory and speed penalties compared to direct JSON manipulation, especially with large or nested datasets.