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. array have data but use QJsonValue value = array.at(i); no content
Forum Updated to NodeBB v4.3 + New Features

array have data but use QJsonValue value = array.at(i); no content

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 195 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.
  • B Offline
    B Offline
    bestmyf_001
    wrote on last edited by
    #1

    why return information is QJsonValue(array,QJsonArray([{"group_id":240,"is_agree":1"}]))
    QJsonArray array = data_value.toArray();
    when I use "QJsonValue value = array.at(i);",value is null.

    Christian EhrlicherC C 2 Replies Last reply
    0
    • B bestmyf_001

      why return information is QJsonValue(array,QJsonArray([{"group_id":240,"is_agree":1"}]))
      QJsonArray array = data_value.toArray();
      when I use "QJsonValue value = array.at(i);",value is null.

      Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Please provide a minimal, compilable example - you don't fill data_value anwhere in your snippets so why should it return anything?

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      2
      • B bestmyf_001

        why return information is QJsonValue(array,QJsonArray([{"group_id":240,"is_agree":1"}]))
        QJsonArray array = data_value.toArray();
        when I use "QJsonValue value = array.at(i);",value is null.

        C Offline
        C Offline
        ChrisW67
        wrote on last edited by
        #3

        @bestmyf_001 Assuming that data_value is actually a QJsonArray... what is the value of i and how many elements are in the array? See QJsonArray::at()

        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