<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Parse JSON array form server]]></title><description><![CDATA[<p dir="auto">Hi,<br />
I get array in  JSON format form server like below:<br />
<img src="https://ddgobkiprc33d.cloudfront.net/9a79bb2c-4ee6-4022-ae14-bca24ad17615.jpg" alt="jsonRecived.jpg" class=" img-fluid img-markdown" /></p>
<p dir="auto">How parse this data to my two variables like below:</p>
<pre><code>void NetworkWorker::networkReply(QByteArray data)
{
    QJsonObject jsonObj;
    QJsonParseError jsonError;
    QJsonDocument loadDoc = QJsonDocument::fromJson(data, &amp;jsonError);
    
    quint16 tomPoints;
    quint16 jerryPoints;
    
    if(jsonError.error != QJsonParseError::NoError){
        qDebug() &lt;&lt; "Error: " &lt;&lt; jsonError.errorString();
    }
    else
    {
        jsonObj = loadDoc.object();
        tomPoints =
        jerryPoints =
    }
}

</code></pre>
<p dir="auto">?</p>
]]></description><link>https://forum.qt.io/topic/142860/parse-json-array-form-server</link><generator>RSS for Node</generator><lastBuildDate>Sat, 13 Jun 2026 14:58:27 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/142860.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 11 Feb 2023 08:13:02 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Parse JSON array form server on Sat, 11 Feb 2023 08:21:11 GMT]]></title><description><![CDATA[<p dir="auto">As you already wrote it's an <a href="https://doc.qt.io/qt-6/qjsondocument.html#array" target="_blank" rel="noopener noreferrer nofollow ugc">array</a>, not an <a href="https://doc.qt.io/qt-6/qjsondocument.html#object" target="_blank" rel="noopener noreferrer nofollow ugc">object</a>, so use the correct function.<br />
And please do not post screenshots but text.</p>
]]></description><link>https://forum.qt.io/post/747204</link><guid isPermaLink="true">https://forum.qt.io/post/747204</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Sat, 11 Feb 2023 08:21:11 GMT</pubDate></item></channel></rss>