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. How can I access json data at c++ code in qml?
Forum Updated to NodeBB v4.3 + New Features

How can I access json data at c++ code in qml?

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 433 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.
  • T Offline
    T Offline
    taedooly
    wrote on last edited by taedooly
    #1

    hi, i'm student learning Qt, i made a simple app for data storage on AWS DB.

    I made my own code querying DB and making c++ class with QJsonObject datas,

    and now i want to access my class data in qml and print it on UI.

    does QJsonObject type support direct access in qml?

    if not, how can i access my json data/?

    raven-worxR 1 Reply Last reply
    0
    • T taedooly

      hi, i'm student learning Qt, i made a simple app for data storage on AWS DB.

      I made my own code querying DB and making c++ class with QJsonObject datas,

      and now i want to access my class data in qml and print it on UI.

      does QJsonObject type support direct access in qml?

      if not, how can i access my json data/?

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @taedooly said in How can I access json data at c++ code in qml?:

      does QJsonObject type support direct access in qml?

      QML converts the QVariantMap type to a JSON object.
      So simply call QJsonObject::toVariantMap() and pass it to on

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      1

      • Login

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