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. QJsonDocument & QNetworkAccessManager
Qt 6.11 is out! See what's new in the release blog

QJsonDocument & QNetworkAccessManager

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 813 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
    shahriar25
    wrote on last edited by
    #1

    Hi
    I want to download and use a json file but when I download and give it to the QJasonDocument and print isEmpty() it prints 1 :

    QByteArray info = reply->readAll();
    
     doc = QJsonDocument::fromJson(info);
    
     cout<<doc.isEmpty()<<endl;
    

    what should I do?

    ? 1 Reply Last reply
    0
    • S shahriar25

      Hi
      I want to download and use a json file but when I download and give it to the QJasonDocument and print isEmpty() it prints 1 :

      QByteArray info = reply->readAll();
      
       doc = QJsonDocument::fromJson(info);
      
       cout<<doc.isEmpty()<<endl;
      

      what should I do?

      ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      @shahriar25 Hi! Check the QJsonParseError from QJsonDocument::fromJson.

      1 Reply Last reply
      1
      • S Offline
        S Offline
        shahriar25
        wrote on last edited by
        #3

        sorry there was a problem with the json file thank you

        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