<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: QJson: from QObject to JSON and vice-versa</title>
	<atom:link href="http://flavio.castelli.name/qjson-qobject-serialization-deserialization/feed" rel="self" type="application/rss+xml" />
	<link>http://flavio.castelli.name/qjson-qobject-serialization-deserialization</link>
	<description>debugging my life</description>
	<lastBuildDate>Sat, 28 Jan 2012 07:37:17 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Flavio</title>
		<link>http://flavio.castelli.name/qjson-qobject-serialization-deserialization/comment-page-1#comment-13267</link>
		<dc:creator>Flavio</dc:creator>
		<pubDate>Fri, 15 Apr 2011 07:40:10 +0000</pubDate>
		<guid isPermaLink="false">http://flavio.castelli.name/?p=273#comment-13267</guid>
		<description>// this is a list not a map
QVariantList filesList = parser.parse(filesListResponse.toAscii(), &amp;parseSuccessful).toList();
foreach (QVariant item, fileList) {
  QVariantMap file = item.toMap();
  qDebug() &lt;&lt; &quot;id:&quot; &lt;&lt; file[&quot;id&quot;].toInt;
  qDebug() &lt;&lt; &quot;file_list:&quot; &lt;&lt; file[&quot;file_list&quot;].toString();
  qDebug() &lt;&lt; &quot;size:&quot; &lt;&lt; file[&quot;size&quot;].toInt();
}</description>
		<content:encoded><![CDATA[<p>// this is a list not a map<br />
QVariantList filesList = parser.parse(filesListResponse.toAscii(), &#038;parseSuccessful).toList();<br />
foreach (QVariant item, fileList) {<br />
  QVariantMap file = item.toMap();<br />
  qDebug() << &#8220;id:&#8221; << file["id"].toInt;<br />
  qDebug() << &#8220;file_list:&#8221; << file["file_list"].toString();<br />
  qDebug() << &#8220;size:&#8221; << file["size"].toInt();<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marius</title>
		<link>http://flavio.castelli.name/qjson-qobject-serialization-deserialization/comment-page-1#comment-13234</link>
		<dc:creator>Marius</dc:creator>
		<pubDate>Mon, 11 Apr 2011 12:56:42 +0000</pubDate>
		<guid isPermaLink="false">http://flavio.castelli.name/?p=273#comment-13234</guid>
		<description>Hi!

How can I access elements of this form?:

[
    {
        &quot;id&quot;: &quot;13302&quot;,
        &quot;files_list&quot;: &quot;phiculator.exe&quot;,
        &quot;size&quot;: &quot;2203915&quot;
    },
    {
        &quot;id&quot;: &quot;13308&quot;,
        &quot;files_list&quot;: &quot;2011-03-24 13.09.29.jpg&quot;,
        &quot;size&quot;: &quot;1541166&quot;
    }
]

I have the following code:

QString filesListResponse = reply-&gt;readAll();

QJson::Parser parser;
bool parseSuccessful;
QMap filesList = parser.parse(filesListResponse.toAscii(), &amp;parseSuccessful).toMap();

if(parseSuccessful)
{
    // now what I want here is to get to (let&#039;s say) the second element, which logically translates to:
    // filesList[1][&quot;size&quot;] which should return &quot;1541166&quot;
    // What can I do this? I probably have to use a foreach() statement in conjunction with another QMap?
    // Thanks!
}</description>
		<content:encoded><![CDATA[<p>Hi!</p>
<p>How can I access elements of this form?:</p>
<p>[<br />
    {<br />
        "id": "13302",<br />
        "files_list": "phiculator.exe",<br />
        "size": "2203915"<br />
    },<br />
    {<br />
        "id": "13308",<br />
        "files_list": "2011-03-24 13.09.29.jpg",<br />
        "size": "1541166"<br />
    }<br />
]</p>
<p>I have the following code:</p>
<p>QString filesListResponse = reply-&gt;readAll();</p>
<p>QJson::Parser parser;<br />
bool parseSuccessful;<br />
QMap filesList = parser.parse(filesListResponse.toAscii(), &amp;parseSuccessful).toMap();</p>
<p>if(parseSuccessful)<br />
{<br />
    // now what I want here is to get to (let&#8217;s say) the second element, which logically translates to:<br />
    // filesList[1]["size"] which should return &#8220;1541166&#8243;<br />
    // What can I do this? I probably have to use a foreach() statement in conjunction with another QMap?<br />
    // Thanks!<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Donald D</title>
		<link>http://flavio.castelli.name/qjson-qobject-serialization-deserialization/comment-page-1#comment-13130</link>
		<dc:creator>Donald D</dc:creator>
		<pubDate>Wed, 16 Mar 2011 13:23:05 +0000</pubDate>
		<guid isPermaLink="false">http://flavio.castelli.name/?p=273#comment-13130</guid>
		<description>First of all, thank you for creating qjson!

I&#039;m having problems with enums. If I test the example, converting from object to string is working perfectly, but when I try to parse the json string, everything gets converted except the enum Gender. Is this a common problem?</description>
		<content:encoded><![CDATA[<p>First of all, thank you for creating qjson!</p>
<p>I&#8217;m having problems with enums. If I test the example, converting from object to string is working perfectly, but when I try to parse the json string, everything gets converted except the enum Gender. Is this a common problem?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Flavio</title>
		<link>http://flavio.castelli.name/qjson-qobject-serialization-deserialization/comment-page-1#comment-13053</link>
		<dc:creator>Flavio</dc:creator>
		<pubDate>Wed, 02 Feb 2011 22:49:27 +0000</pubDate>
		<guid isPermaLink="false">http://flavio.castelli.name/?p=273#comment-13053</guid>
		<description>In these situations you have to write a manual serialization procedure which iterates over the complex structures of your class.</description>
		<content:encoded><![CDATA[<p>In these situations you have to write a manual serialization procedure which iterates over the complex structures of your class.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Johan Paul</title>
		<link>http://flavio.castelli.name/qjson-qobject-serialization-deserialization/comment-page-1#comment-13049</link>
		<dc:creator>Johan Paul</dc:creator>
		<pubDate>Mon, 31 Jan 2011 23:04:21 +0000</pubDate>
		<guid isPermaLink="false">http://flavio.castelli.name/?p=273#comment-13049</guid>
		<description>I find QJSON a very good JSON parser for Qt, so thank  you for that! But what has been discussed on the comments here still seems to be the case; serialization of more complex JSON values / QObjects is still not possible, right? Like having arrays of arrays.</description>
		<content:encoded><![CDATA[<p>I find QJSON a very good JSON parser for Qt, so thank  you for that! But what has been discussed on the comments here still seems to be the case; serialization of more complex JSON values / QObjects is still not possible, right? Like having arrays of arrays.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ♥ QJSON ♥ &#171; Apachelogger&#39;s Log</title>
		<link>http://flavio.castelli.name/qjson-qobject-serialization-deserialization/comment-page-1#comment-10662</link>
		<dc:creator>♥ QJSON ♥ &#171; Apachelogger&#39;s Log</dc:creator>
		<pubDate>Wed, 02 Jun 2010 08:26:22 +0000</pubDate>
		<guid isPermaLink="false">http://flavio.castelli.name/?p=273#comment-10662</guid>
		<description>[...] and a int property named &#8220;bar&#8221; in order to deserialize this map. Please take a look at this blog post about serialization and deserialization of JSON and QObjects. It should make the basics very easy [...]</description>
		<content:encoded><![CDATA[<p>[...] and a int property named &#8220;bar&#8221; in order to deserialize this map. Please take a look at this blog post about serialization and deserialization of JSON and QObjects. It should make the basics very easy [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sammy D'Souza</title>
		<link>http://flavio.castelli.name/qjson-qobject-serialization-deserialization/comment-page-1#comment-10649</link>
		<dc:creator>Sammy D'Souza</dc:creator>
		<pubDate>Tue, 18 May 2010 01:17:53 +0000</pubDate>
		<guid isPermaLink="false">http://flavio.castelli.name/?p=273#comment-10649</guid>
		<description>Hi Flavio
    Have you had a chance to do this? You&#039;d mentioned taking care of nested types such that eventually qObjectHelper would be un-necessary - is that done?

    Essentially, what is your recommendation for going from JSON to/from a hydrated Object that can contain other objects or lists of objects?

Thanks
Sammy</description>
		<content:encoded><![CDATA[<p>Hi Flavio<br />
    Have you had a chance to do this? You&#8217;d mentioned taking care of nested types such that eventually qObjectHelper would be un-necessary &#8211; is that done?</p>
<p>    Essentially, what is your recommendation for going from JSON to/from a hydrated Object that can contain other objects or lists of objects?</p>
<p>Thanks<br />
Sammy</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sammy D'Souza</title>
		<link>http://flavio.castelli.name/qjson-qobject-serialization-deserialization/comment-page-1#comment-10645</link>
		<dc:creator>Sammy D'Souza</dc:creator>
		<pubDate>Fri, 14 May 2010 04:30:16 +0000</pubDate>
		<guid isPermaLink="false">http://flavio.castelli.name/?p=273#comment-10645</guid>
		<description>Flavio

        Do you have any examples for complex JSON objects? I&#039;m thinking objects that contain other objects or arrays of other objects or stuff like that... for instance, a JSON response like http://services.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer?f=pjson

Thanks
Sammy</description>
		<content:encoded><![CDATA[<p>Flavio</p>
<p>        Do you have any examples for complex JSON objects? I&#8217;m thinking objects that contain other objects or arrays of other objects or stuff like that&#8230; for instance, a JSON response like <a href="http://services.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer?f=pjson" rel="nofollow">http://services.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer?f=pjson</a></p>
<p>Thanks<br />
Sammy</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Flavio</title>
		<link>http://flavio.castelli.name/qjson-qobject-serialization-deserialization/comment-page-1#comment-10364</link>
		<dc:creator>Flavio</dc:creator>
		<pubDate>Sat, 05 Dec 2009 17:54:47 +0000</pubDate>
		<guid isPermaLink="false">http://flavio.castelli.name/?p=273#comment-10364</guid>
		<description>Well, the serialization would just require more time...</description>
		<content:encoded><![CDATA[<p>Well, the serialization would just require more time&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Flavio</title>
		<link>http://flavio.castelli.name/qjson-qobject-serialization-deserialization/comment-page-1#comment-10363</link>
		<dc:creator>Flavio</dc:creator>
		<pubDate>Sat, 05 Dec 2009 17:48:39 +0000</pubDate>
		<guid isPermaLink="false">http://flavio.castelli.name/?p=273#comment-10363</guid>
		<description>This isn&#039;t possible because of certain error handling code.</description>
		<content:encoded><![CDATA[<p>This isn&#8217;t possible because of certain error handling code.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

