Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Create json file with multiple arrays.
Forum Updated to NodeBB v4.3 + New Features

Create json file with multiple arrays.

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 236 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Cihangir
    wrote on 27 Aug 2020, 06:08 last edited by
    #1

    Hi All,
    I'm in a mess of json arrays and objects. I want to create a Json file as follows. I've tried too many combinations but I failed. How it should be? I'm waiting for your help. Thanks All.

    The format I'm trying to do;
    {
    "Titles": [
    {
    "First" : [
    {
    "Title":"Hello"
    },
    {
    "Title":"Thank"
    },
    {
    "Title":"You"
    }
    ],
    "Last":[
    {
    "Title":"Good"
    },
    {
    "Title":"Bye"
    }
    ]
    }
    ]
    }

    J J 2 Replies Last reply 27 Aug 2020, 06:21
    0
    • C Cihangir
      27 Aug 2020, 06:08

      Hi All,
      I'm in a mess of json arrays and objects. I want to create a Json file as follows. I've tried too many combinations but I failed. How it should be? I'm waiting for your help. Thanks All.

      The format I'm trying to do;
      {
      "Titles": [
      {
      "First" : [
      {
      "Title":"Hello"
      },
      {
      "Title":"Thank"
      },
      {
      "Title":"You"
      }
      ],
      "Last":[
      {
      "Title":"Good"
      },
      {
      "Title":"Bye"
      }
      ]
      }
      ]
      }

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 27 Aug 2020, 06:21 last edited by
      #2

      @Cihangir Like this

      {
      	"Titles": {
      		"First": [{
      				"Title": "Hello"
      			},
      			{
      				"Title": "Thank"
      			},
      			{
      				"Title": "You"
      			}
      		],
      		"Last": [{
      				"Title": "Good"
      			},
      			{
      				"Title": "Bye"
      			}
      		]
      	}
      }
      

      ?
      There are JSON validators you can use to validate your JSON and find errors.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2
      • C Cihangir
        27 Aug 2020, 06:08

        Hi All,
        I'm in a mess of json arrays and objects. I want to create a Json file as follows. I've tried too many combinations but I failed. How it should be? I'm waiting for your help. Thanks All.

        The format I'm trying to do;
        {
        "Titles": [
        {
        "First" : [
        {
        "Title":"Hello"
        },
        {
        "Title":"Thank"
        },
        {
        "Title":"You"
        }
        ],
        "Last":[
        {
        "Title":"Good"
        },
        {
        "Title":"Bye"
        }
        ]
        }
        ]
        }

        J Offline
        J Offline
        JonB
        wrote on 27 Aug 2020, 16:20 last edited by
        #3

        @Cihangir
        Are you looking for the text of the JSON file which @jsulm has given you, or are you looking to generate the file from code with Qt JSON classes?

        1 Reply Last reply
        0

        2/3

        27 Aug 2020, 06:21

        • Login

        • Login or register to search.
        2 out of 3
        • First post
          2/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved