O'Reilly logo

Game Programming using Qt 5 Beginner's Guide - Second Edition by Lorenz Haas, Witold Wysota, Pavel Strakhov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

JSON files

JSON stands for "JavaScript Object Notation", which is a popular lightweight textual format that is used to store object-oriented data in a human-readable form. It comes from JavaScript where it is the native format used to store object information; however, it is commonly used across many programming languages and a popular format for web data exchange. Qt Core supports JSON format, as we'll see in the following code. A simple JSON-formatted definition looks as follows:

{
    "name": "Joe",
    "age": 14,
    "inventory": [
        { "type": "gold", "amount": "144000" },
        { "type": "short_sword", "material": "iron" }
    ]
} 

JSON objects can contain values of the following types:

Type Description
bool A boolean value (true or false).
double

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required