Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Foreach json with indexes and values



  • Hello everyone. there is a way to put in a foreach, a json object and retrieve various indices and their values?
    example, if I have a json file:
    [code]
    {
    "a":"1",
    "b":"5",
    "c":"9",
    "d":"2"
    }
    [/code]
    I would like a foreach, show me
    a = 1
    b = 5
    c = 9
    d = 2

    ps: Googling I saw how to do a foreach and show only the values, without indexes


Log in to reply