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. Accessing the Nested Data in ListModel or alternatives
Forum Updated to NodeBB v4.3 + New Features

Accessing the Nested Data in ListModel or alternatives

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 140 Views 1 Watching
  • 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.
  • S Offline
    S Offline
    Shubham_Senpai
    wrote on last edited by
    #1

    i am creating a nested dropdown in qml. and for this data is like this
    property var countries: [
    {
    name: "abc",
    utc: {
    shortname: "a",
    utc: "5.30"
    }
    },
    {
    name: "pqr",
    utc: [
    {
    shortname: "b",
    utc: "+10:00"
    },
    {
    shortname: "c",
    utc: "+11:00"
    },
    {
    shortname: "d",
    utc: "+5:00"
    }
    ]
    }
    ]

    now i want to access this data in dropdown which approach i can take?
    I tried ListModel for this but ListElement will not take the nested data

    Axel SpoerlA 1 Reply Last reply
    0
    • S Shubham_Senpai

      i am creating a nested dropdown in qml. and for this data is like this
      property var countries: [
      {
      name: "abc",
      utc: {
      shortname: "a",
      utc: "5.30"
      }
      },
      {
      name: "pqr",
      utc: [
      {
      shortname: "b",
      utc: "+10:00"
      },
      {
      shortname: "c",
      utc: "+11:00"
      },
      {
      shortname: "d",
      utc: "+5:00"
      }
      ]
      }
      ]

      now i want to access this data in dropdown which approach i can take?
      I tried ListModel for this but ListElement will not take the nested data

      Axel SpoerlA Offline
      Axel SpoerlA Offline
      Axel Spoerl
      Moderators
      wrote on last edited by
      #2

      @Shubham_Senpai
      Please edit your post and use the code tags to format the code you post.
      Makes it much easier to read and reply :-)

      Software Engineer
      The Qt Company, Oslo

      1 Reply Last reply
      0

      • Login

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