<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Th30z - Coding on the Fly &#187; Qt4</title>
	<atom:link href="http://th30z.netsons.org/category/qt4/feed/" rel="self" type="application/rss+xml" />
	<link>http://th30z.netsons.org</link>
	<description>Matteo Bertozzi, Objective-C, Cocoa, C, C++, Qt4, iPhone, Mac OS X, Open Moko, Matteo Bertozzi Development</description>
	<lastBuildDate>Sun, 22 Nov 2009 09:47:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Qt4 Imap API</title>
		<link>http://th30z.netsons.org/2009/08/qt4-imap-api/</link>
		<comments>http://th30z.netsons.org/2009/08/qt4-imap-api/#comments</comments>
		<pubDate>Sat, 01 Aug 2009 05:39:07 +0000</pubDate>
		<dc:creator>Matteo Bertozzi</dc:creator>
				<category><![CDATA[Qt4]]></category>
		<category><![CDATA[Imap]]></category>
		<category><![CDATA[RFC]]></category>

		<guid isPermaLink="false">http://th30z.netsons.org/?p=1083</guid>
		<description><![CDATA[Pushed in my GitHub repo the first draft of the Qt4 Imap (RFC 3501 Interne Message Access Protocol) Library.
I&#8217;ve implemented a sync communication because it&#8217;s much easier to use, so if you want to use it in async way you need to implement a thread class that wrap the Imap class and throws the events [...]]]></description>
			<content:encoded><![CDATA[<p>Pushed in my <a title="Git Hub Qt4 Imap" href="http://github.com/matteobertozzi/Qt-Widgets-Components-Library/tree/1173eec8dcbb1931054c646c675541e8d5514153/Imap">GitHub</a> repo the first draft of the Qt4 Imap (<a title="Imap RFC" href="http://www.faqs.org/rfcs/rfc3501.html">RFC 3501</a> Interne Message Access Protocol) Library.<br />
I&#8217;ve implemented a sync communication because it&#8217;s much easier to use, so if you want to use it in async way you need to implement a thread class that wrap the Imap class and throws the events that you need.<br />
<code></p>
<pre>
Imap imap;
if (!imap.connectToHost(IMAP_HOST, IMAP_PORT, IMAP_USE_SSL))
   IMAP_MAIN_ABORT(&quot;connectToHost()&quot;, imap.errorString());

if (!imap.login(IMAP_USERNAME, IMAP_PASSWORD, IMAP_LOGIN_TYPE))
   IMAP_MAIN_ABORT(&quot;login()&quot;, imap.errorString());

ImapMailbox *mailbox = imap.select(&quot;INBOX&quot;);
qDebug() &lt;&lt; &quot;INBOX&quot;;
qDebug() &lt;&lt; &quot; - Exists:&quot; &lt;&lt; mailbox-&gt;exists();
qDebug() &lt;&lt; &quot; - Unseen:&quot; &lt;&lt; mailbox-&gt;unseen();

QList&lt;int&gt; messageList = imap.searchRecentUnseen();
imap.fetch(mailbox, messageList);
foreach (int msgId, messageList) {
   ImapMessage *message = mailbox-&gt;findById(msgId);
   if (message == NULL) continue;

   imap.fetchBodyStructure(message);

   qDebug() &lt;&lt; &quot;FROM&quot; &lt;&lt; message-&gt;fromAddress().toString();
   foreach (ImapAddress address, message-&gt;toAddresses())
      qDebug() &lt;&lt; &quot; - TO&quot; &lt;&lt; address.toString();
   qDebug() &lt;&lt; &quot;SUBJECT&quot; &lt;&lt; message-&gt;subject();

   for (int i = 0; i &lt; message-&gt;bodyPartCount(); ++i) {
      ImapMessageBodyPart *bodyPart = message-&gt;bodyPartAt(i);
      imap.fetchBodyPart(message, i);

      qDebug() &lt;&lt; bodyPart-&gt;isAttachment() &lt;&lt; bodyPart-&gt;contentType();
      qDebug() &lt;&lt; bodyPart-&gt;data();
   }
}

delete mailbox;

imap.logout();
imap.disconnectFromHost();
</pre>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://th30z.netsons.org/2009/08/qt4-imap-api/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Qt4 Google Contacts APIs</title>
		<link>http://th30z.netsons.org/2009/07/qt4-google-contacts-apis/</link>
		<comments>http://th30z.netsons.org/2009/07/qt4-google-contacts-apis/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 05:53:54 +0000</pubDate>
		<dc:creator>Matteo Bertozzi</dc:creator>
				<category><![CDATA[Qt4]]></category>
		<category><![CDATA[Google Services]]></category>

		<guid isPermaLink="false">http://th30z.netsons.org/?p=1078</guid>
		<description><![CDATA[Just pushed at GitHub the first draft of the Qt4 Google Contacts Service&#8230;
Contacts APIs allows client applications to view and update Contacts content in the form of Google Data API feeds. Your client application can request a list of a user&#8217;s contacts, edit or delete content in an existing contact.


// Setup Contact
THGoogleContact *contact = new [...]]]></description>
			<content:encoded><![CDATA[<p>Just pushed at <a title="Git Hub Qt4 Google Contacts Service" href="http://github.com/matteobertozzi/Qt-Widgets-Components-Library/tree/ff7c8332552dbbd1233b6887545dd2dc52dddbc4/Google">GitHub</a> the first draft of the Qt4 <a title="Google Contacts" href="http://code.google.com/apis/contacts/">Google Contacts</a> Service&#8230;</p>
<p>Contacts APIs allows client applications to view and update Contacts content in the form of Google Data API feeds. Your client application can request a list of a user&#8217;s contacts, edit or delete content in an existing contact.<br />
<code></p>
<pre>
// Setup Contact
THGoogleContact *contact = new THGoogleContact;
contact-&gt;setFullName(&quot;John Doe&quot;);

THGoogleIm *im = new THGoogleIm;
im-&gt;setRel(THGoogleIm::relWork());
im-&gt;setAddress(&quot;john.doe@aim.com&quot;);
im-&gt;setProtocol(THGoogleIm::protocolAim());
contact-&gt;addImAddress(im);

THGoogleEmail *email = new THGoogleEmail;
email-&gt;setAddress(&quot;john.doe@mail.com&quot;);
email-&gt;setRel(THGoogleEmail::relWork());
contact-&gt;addEmailAddress(email);

// Insert Contact
THGoogleContactsService *gContacts = new THGoogleContactsService;
gContacts-&gt;setAuthToken(...);
gContacts-&gt;insertContact(contact);
</pre>
<p></code><br />
Take a look at <a href="http://github.com/matteobertozzi/Qt-Widgets-Components-Library/blob/ff7c8332552dbbd1233b6887545dd2dc52dddbc4/Google/tests/ContactsTest/contactstest.cpp">contacttest.cpp</a> for a more complete usage example.</p>
]]></content:encoded>
			<wfw:commentRss>http://th30z.netsons.org/2009/07/qt4-google-contacts-apis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Qt4 Google MapView</title>
		<link>http://th30z.netsons.org/2009/07/qt4-google-mapview/</link>
		<comments>http://th30z.netsons.org/2009/07/qt4-google-mapview/#comments</comments>
		<pubDate>Sun, 12 Jul 2009 09:07:07 +0000</pubDate>
		<dc:creator>Matteo Bertozzi</dc:creator>
				<category><![CDATA[Qt4]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[WebKit]]></category>

		<guid isPermaLink="false">http://th30z.netsons.org/?p=988</guid>
		<description><![CDATA[I&#8217;ve received a couple of requests about Google Maps and Qt4. Today I&#8217;ve written a simple Widget that allows you to interact with Google Maps and Google Geocoder. You can set Map Type (Roadmap, Satellite, Terrain and Hybrid), you can set your center Coordinate, add Markers, add Info Windows get the User Click Coordinates and [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve received a couple of requests about Google Maps and Qt4. Today I&#8217;ve written a simple Widget that allows you to interact with Google Maps and Google Geocoder. You can set Map Type (Roadmap, Satellite, Terrain and Hybrid), you can set your center Coordinate, add Markers, add Info Windows get the User Click Coordinates and other things that Google Maps allows to do.</p>
<p><a href="http://th30z.netsons.org/wp-content/uploads/Qt4GKMapView.png"><img class="aligncenter size-full wp-image-991" title="Qt4 Google MapView" src="http://th30z.netsons.org/wp-content/uploads/Qt4GKMapView.png" alt="Qt4 Google MapView" width="575" height="400" /></a></p>
<p>With few lines of code, you can interact with Google Maps, and below you can see how to do it. (<em>Other methods and overloads are available, check the GKMapView.h in the Source Code packet, link is at the end of the post</em>).<br />
<code></p>
<pre>
GKMapView mapView;

// Change the Default MapType (Roadmap, Satellite, Terrain, Hybrid)
mapView.setMapType(GKMapTypeSatellite);

// Use Geocoder to Get Location from Address or Viceversa.
// See the Signals locationFound, locationNotFound() and
// addressFound(), addressNotFound() to get your results.
mapView.locationFromAddress(&quot;San Mateo&quot;);
mapView.addressFromLocation(32.718834, -117.164);

// Add Marker With Info Window at Specified Address (or Location)
mapView.addMarkerWithWindow(&quot;Bedford MA Marker&quot;,
                            &quot;&lt;b&gt;Bedford MA&lt;/b&gt; Marker&quot;,
                            &quot;Bedford MA&quot;);

// Add Info Window without Marker using Address or Coordinates
mapView.addInfoWindow(&quot;Hello from &lt;b&gt;San Mateo&lt;/b&gt;&quot;, &quot;San Mateo&quot;);
mapView.addInfoWindow(&quot;Hello from &lt;b&gt;San Diego&lt;/b&gt;&quot;, 32.718834, -117.164);

// Change your Current Location
mapView.setLocation(&quot;Phoenix AZ&quot;);
</pre>
<p></code></p>
<p>The Source Code is available Here with a small example: <a href="http://th30z.netsons.org/wp-content/uploads/Qt4GoogleMapView.zip">Qt4 Google Map View Source Code</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://th30z.netsons.org/2009/07/qt4-google-mapview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Qt4 Canvas Plugins</title>
		<link>http://th30z.netsons.org/2009/06/qt4-canvas-plugins/</link>
		<comments>http://th30z.netsons.org/2009/06/qt4-canvas-plugins/#comments</comments>
		<pubDate>Sun, 28 Jun 2009 10:52:46 +0000</pubDate>
		<dc:creator>Matteo Bertozzi</dc:creator>
				<category><![CDATA[Qt4]]></category>
		<category><![CDATA[Plugins]]></category>

		<guid isPermaLink="false">http://th30z.netsons.org/?p=954</guid>
		<description><![CDATA[Today, during my Sunday morning bike trip I&#8217;ve had an Idea on how to simply implement a Canvas Plugins in Qt Applications, to give you an idea of How browser external plugins like flash or others works. The Code is really simple there&#8217;s a class CanvasPlugin with a couple of Abstract Methods Init, UnInit, Resize, [...]]]></description>
			<content:encoded><![CDATA[<p>Today, during my Sunday morning bike trip I&#8217;ve had an Idea on how to simply implement a Canvas Plugins in Qt Applications, to give you an idea of How browser external plugins like flash or others works. The Code is really simple there&#8217;s a class CanvasPlugin with a couple of Abstract Methods Init, UnInit, Resize, MouseEvent and a signal that says &#8220;Hey, Paint this Image!&#8221;. To give you an Idea of the result below you can see a Window with two Widgets, a CanvasPluginViewer and a Label. Canvas Plugin Viewer load an external Library (.so) passed to the command line as first argument.</p>
<p><a href="http://th30z.netsons.org/wp-content/uploads/QtCanvasPlugin.png"><img class="aligncenter size-full wp-image-955" title="Qt Canvas Plugin Example" src="http://th30z.netsons.org/wp-content/uploads/QtCanvasPlugin.png" alt="Qt Canvas Plugin Example" width="522" height="358" /></a><br />
You can interact with the canvas like a normal widget (the red square moves along the window and you can stop and resume its animation). But you can extend the sample sending and receiving information from a server, or you can do other crazy external things. (See flash usage for more ideas).</p>
<p>That&#8217;s all folks, it&#8217;s lunch time. If you&#8217;ve any question send me a mail or write a comment, and remember that this is just a couple of minutes coded example, so don&#8217;t use in your highly stable app. <img src='http://th30z.netsons.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The Source Code is Available Here: <a title="Qt4 Canvas Plugins Source Code" href="http://th30z.netsons.org/wp-content/uploads/QtCanvasPlugin.zip">Qt4 Canvas Plugins Source Code</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://th30z.netsons.org/2009/06/qt4-canvas-plugins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Qt4 iPhone Like Cut/Copy/Paste Widget</title>
		<link>http://th30z.netsons.org/2009/06/qt4-iphone-like-cutcopypaste-widget/</link>
		<comments>http://th30z.netsons.org/2009/06/qt4-iphone-like-cutcopypaste-widget/#comments</comments>
		<pubDate>Sat, 13 Jun 2009 17:36:55 +0000</pubDate>
		<dc:creator>Matteo Bertozzi</dc:creator>
				<category><![CDATA[Qt4]]></category>

		<guid isPermaLink="false">http://th30z.netsons.org/?p=929</guid>
		<description><![CDATA[I&#8217;m watching the WWDC Keynote podcast, Just finished the Bertrand Serlet Talk, about Snow Leopard. Now before watching Scott Forstall with the new iPhone 3GS, a little break with an example of Cut, Copy and Paste like Widget. (In the Snow Leopard dock demo, I&#8217;ve seen &#8220;the same&#8221; widget used to do expose)

It&#8217;s a really [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m watching the <a title="Apple WWDC" href="http://developer.apple.com/wwdc/">WWDC</a> Keynote podcast, Just finished the Bertrand Serlet Talk, about <a title="Mac OS X Snow Leopard" href="http://www.apple.com/macosx/">Snow Leopard</a>. Now before watching Scott Forstall with the new <a title="Apple iPhone" href="http://www.apple.com/iphone/">iPhone 3GS</a>, a little break with an example of Cut, Copy and Paste like Widget. (In the Snow Leopard dock demo, I&#8217;ve seen &#8220;the same&#8221; widget used to do expose)</p>
<p><a href="http://th30z.netsons.org/wp-content/uploads/QtCutPasteIPhone.png"><img class="aligncenter size-full wp-image-930" title="Qt Cut Copy and Paste IPhone Like" src="http://th30z.netsons.org/wp-content/uploads/QtCutPasteIPhone.png" alt="Qt Cut Copy and Paste IPhone Like" width="349" height="139" /></a><br />
It&#8217;s a really simple example but it can be useful to someone to understand how to add actions to a custom shape.</p>
<p>The Source Code is available Here: <a title="Qt4 iPhone Like Cut Copy and Paste Source Code" href="http://th30z.netsons.org/wp-content/uploads/QtCutPasteIPhoneLike.zip">Qt4 iPhone Like Cut, Copy Paste Source Code</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://th30z.netsons.org/2009/06/qt4-iphone-like-cutcopypaste-widget/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Qt4 Geo IP Location</title>
		<link>http://th30z.netsons.org/2009/06/qt4-geo-ip-location/</link>
		<comments>http://th30z.netsons.org/2009/06/qt4-geo-ip-location/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 05:52:57 +0000</pubDate>
		<dc:creator>Matteo Bertozzi</dc:creator>
				<category><![CDATA[Qt4]]></category>
		<category><![CDATA[GeoLocation]]></category>
		<category><![CDATA[WebKit]]></category>

		<guid isPermaLink="false">http://th30z.netsons.org/?p=921</guid>
		<description><![CDATA[In a time of Google Maps, Geo Location and other services like this&#8230; Here an example of Geo IP Location Service (http://www.hostip.info/) is really far from perfect, but it&#8217;s just an example.

The sample uses QNetworkAccessManager to get the Geo Location of the IP, and Webkit to display the address on the Google Map.
The Source Code [...]]]></description>
			<content:encoded><![CDATA[<p>In a time of Google Maps, Geo Location and other services like this&#8230; Here an example of Geo IP Location Service (<a title="Host IP Info" href="http://www.hostip.info/">http://www.hostip.info/</a>) is really far from perfect, but it&#8217;s just an example.</p>
<p><a href="http://th30z.netsons.org/wp-content/uploads/qtgeoiplocation.png"><img class="aligncenter size-full wp-image-923" title="Qt Geo IP Location" src="http://th30z.netsons.org/wp-content/uploads/qtgeoiplocation.png" alt="Qt Geo IP Location" width="509" height="431" /></a></p>
<p><em>The sample uses QNetworkAccessManager to get the Geo Location of the IP, and Webkit to display the address on the Google Map.</em></p>
<p>The Source Code is available Here: <a title="Qt Geo IP Location Source Code" href="http://th30z.netsons.org/wp-content/uploads/qtgeoiplocation.zip">Qt4 Geo IP Location Source Code</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://th30z.netsons.org/2009/06/qt4-geo-ip-location/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Qt4 Google Services: Translator, Spell Checker and more&#8230;</title>
		<link>http://th30z.netsons.org/2009/06/qt4-google-services-translator-spell-checker-and-more/</link>
		<comments>http://th30z.netsons.org/2009/06/qt4-google-services-translator-spell-checker-and-more/#comments</comments>
		<pubDate>Sat, 06 Jun 2009 07:31:16 +0000</pubDate>
		<dc:creator>Matteo Bertozzi</dc:creator>
				<category><![CDATA[Qt4]]></category>
		<category><![CDATA[Google Services]]></category>

		<guid isPermaLink="false">http://th30z.netsons.org/?p=908</guid>
		<description><![CDATA[Last month I&#8217;ve made a simple wrapper for Google Authentication, Today I&#8217;ve written other 4 classes to wrap the Google&#8217;s Translator, Language Detector, Suggestions and the Spell Checker Services.
Translator Example


QEventLoop l;
THGoogleTranslator gTranslator;
connect(&#38;gTranslator, SIGNAL(finished(bool)), &#38;l, SLOT(quit()));
gTranslator.setDestinationLanguage(&#34;en&#34;);
gTranslator.translate(&#34;Ciao&#34;);
l.exec();

qDebug() &#60;&#60; gTranslator.translatedText(); // Maybe "Hello"
qDebug() &#60;&#60; gTranslator.detectedSourceLanguage(); // Maybe "it"


Suggest Example


QEventLoop l;
THGoogleSuggest gSuggest;
connect(&#38;gSuggest, SIGNAL(finished(bool)), &#38;l, SLOT(quit()));
gSuggest.suggest(&#34;Qt Softw&#34;);
l.exec();

qDebug() &#60;&#60; gSuggest.suggestions();
// ("qt [...]]]></description>
			<content:encoded><![CDATA[<p>Last month I&#8217;ve made a simple wrapper for <a title="Qt4 Google Auth" href="http://th30z.netsons.org/2009/05/qt4-google-authentication/">Google Authentication</a>, Today I&#8217;ve written other 4 classes to wrap the Google&#8217;s Translator, Language Detector, Suggestions and the Spell Checker Services.</p>
<h2>Translator Example</h3>
<p><code></p>
<pre>
QEventLoop l;
THGoogleTranslator gTranslator;
connect(&amp;gTranslator, SIGNAL(finished(bool)), &amp;l, SLOT(quit()));
gTranslator.setDestinationLanguage(&quot;en&quot;);
gTranslator.translate(&quot;Ciao&quot;);
l.exec();

qDebug() &lt;&lt; gTranslator.translatedText(); // Maybe "Hello"
qDebug() &lt;&lt; gTranslator.detectedSourceLanguage(); // Maybe "it"
</pre>
<p></code></p>
<h2>Suggest Example</h3>
<p><code></p>
<pre>
QEventLoop l;
THGoogleSuggest gSuggest;
connect(&amp;gSuggest, SIGNAL(finished(bool)), &amp;l, SLOT(quit()));
gSuggest.suggest(&quot;Qt Softw&quot;);
l.exec();

qDebug() &lt;&lt; gSuggest.suggestions();
// ("qt software", "qt software download", "qt software gpl exception", ...)
</pre>
<p></code></p>
<h2>Spell Checker Example</h3>
<p><code></p>
<pre>
QEventLoop l;
THGoogleSpellChecker gSpellChecker;
connect(&amp;gSpellChecker, SIGNAL(finished(bool)), &amp;l, SLOT(quit()));
gSpellChecker.spellCheck(&quot;Gogl Spll&quot;);
l.exec();

// "Gogl" ("Google", "Gogol", "Gog", "Goal", "Gog's")
// "Spll" ("Spell", "Sp ll", "Sp-ll", "Spill", "Sell")
foreach (QString original, gSpellChecker.keys())
    qDebug() &lt;&lt; original &lt;&lt; gSpellChecker.suggestions(original);
</pre>
<p></code></p>
<h2>Language Detector Example</h3>
<p><code></p>
<pre>
QEventLoop l;
THGoogleDetectLanguage gDetectLang;
connect(&amp;gDetectLang, SIGNAL(finished(bool)), &amp;l, SLOT(quit()));
gDetectLang.detectLanguage(&quot;Ciao&quot;);
l.exec();

qDebug() &lt;&lt; &quot;Query&quot; &lt;&lt; gDetectLang.query();
qDebug() &lt;&lt; &quot;Language&quot; &lt;&lt; gDetectLang.language(); // Maybe "it"
qDebug() &lt;&lt; &quot;Is Reliable&quot; &lt;&lt; gDetectLang.isReliable();
qDebug() &lt;&lt; &quot;Confidence&quot; &lt;&lt; gDetectLang.confidence();
</pre>
<p></code></p>
<p>You can find the source at <a href="http://github.com/matteobertozzi/Qt-Widgets-Components-Library/tree/master">GitHub</a> (<a href="http://github.com/matteobertozzi/Qt-Widgets-Components-Library/tree/6b26b3ce6aff4eb6c55eb636ebe8036402c12108/Google">Git WebView</a>) or you can download the source code Here: <a href="http://th30z.netsons.org/wp-content/uploads/qtgoogletake2.zip">Qt4 Google Services Take 2 Source Code</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://th30z.netsons.org/2009/06/qt4-google-services-translator-spell-checker-and-more/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Qt4 Jump Away Animation</title>
		<link>http://th30z.netsons.org/2009/05/qt4-jump-away-animation/</link>
		<comments>http://th30z.netsons.org/2009/05/qt4-jump-away-animation/#comments</comments>
		<pubDate>Sat, 16 May 2009 16:24:53 +0000</pubDate>
		<dc:creator>Matteo Bertozzi</dc:creator>
				<category><![CDATA[Qt4]]></category>
		<category><![CDATA[Effects]]></category>

		<guid isPermaLink="false">http://th30z.netsons.org/?p=883</guid>
		<description><![CDATA[When I&#8217;ve started working on Mac OS X with Core Animation, I was impressed by an Example (I don&#8217;t remember the link, if someone knows it, post it in the comments! thanks)&#8230; Very few lines of code for a great effect.
After a year, or probably more.. this example was came back to my mind, so [...]]]></description>
			<content:encoded><![CDATA[<p>When I&#8217;ve started working on Mac OS X with Core Animation, I was impressed by an Example (I don&#8217;t remember the link, if someone knows it, post it in the comments! thanks)&#8230; Very few lines of code for a great effect.</p>
<p>After a year, or probably more.. this example was came back to my mind, so I&#8217;ve decided to clone using Qt. And below you can see a short <a href="http://www.youtube.com/watch?v=ifM2hKubwhQ">Demonstration Video</a>. Your desktop jump away.. full screen is fantastic <img src='http://th30z.netsons.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p style="text-align: center;"><object width="425" height="344" data="http://www.youtube.com/v/ifM2hKubwhQ&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/ifM2hKubwhQ&amp;hl=en&amp;fs=1" /><param name="allowfullscreen" value="true" /></object></p>
<p>The Source Code is Available Here: <a href="http://th30z.netsons.org/wp-content/uploads/qt4jumpaway.zip">Qt4 Jump Away Animation Source Code</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://th30z.netsons.org/2009/05/qt4-jump-away-animation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PyQt4: PyCon3 Photos on Flickr</title>
		<link>http://th30z.netsons.org/2009/05/pyqt4-pycon3-photos-on-flickr/</link>
		<comments>http://th30z.netsons.org/2009/05/pyqt4-pycon3-photos-on-flickr/#comments</comments>
		<pubDate>Sat, 16 May 2009 05:44:19 +0000</pubDate>
		<dc:creator>Matteo Bertozzi</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[Qt4]]></category>
		<category><![CDATA[Flickr]]></category>
		<category><![CDATA[PyCon3]]></category>
		<category><![CDATA[PyQt4]]></category>

		<guid isPermaLink="false">http://th30z.netsons.org/?p=869</guid>
		<description><![CDATA[PyCon3 was finished, Only one week is passed and I already miss it.  Guido van Rossum, Alex Martelli, Ariya Hidayat, Raymond Hettinger, David Boddie, Fredrik Lundh&#8230; C/C++ and Python Developer not .NET &#8220;coders&#8221; (I hate even more my boring .NET job).
Following the PyCon week, here a simple example of PyQt4 that allows you to [...]]]></description>
			<content:encoded><![CDATA[<p>PyCon3 was finished, Only one week is passed and I already miss it.  <em>Guido van Rossum</em>, <em>Alex Martelli</em>, <em>Ariya Hidayat</em>, <em>Raymond Hettinger</em>, <em>David Boddie</em>, <em>Fredrik Lundh</em>&#8230; C/C++ and Python Developer not .NET &#8220;coders&#8221; (I hate even more my boring .NET job).</p>
<p>Following the PyCon week, here a simple example of <strong>PyQt4</strong> that allows you to see up to 500 photos tagged PyCon3 on Flickr.</p>
<p style="text-align: center;"><a href="http://th30z.netsons.org/wp-content/uploads/pyqt4-pycon3flickr.png"><img class="aligncenter size-full wp-image-873" title="PyQt4 PyCon3 Flickr" src="http://th30z.netsons.org/wp-content/uploads/pyqt4-pycon3flickr.png" alt="PyQt4 PyCon3 Flickr" width="554" height="408" /></a></p>
<p>As always the source code is available here: <a title="PyQt4 PyCon3 Flickr Source Code" href="http://th30z.netsons.org/wp-content/uploads/pyqt4-pycon3flickr.zip">PyQt4 PyCon3 Flickr Source Code</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://th30z.netsons.org/2009/05/pyqt4-pycon3-photos-on-flickr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Qt4 Touch and Rotate</title>
		<link>http://th30z.netsons.org/2009/05/qt4-touch-and-rotate/</link>
		<comments>http://th30z.netsons.org/2009/05/qt4-touch-and-rotate/#comments</comments>
		<pubDate>Thu, 07 May 2009 04:27:01 +0000</pubDate>
		<dc:creator>Matteo Bertozzi</dc:creator>
				<category><![CDATA[Qt4]]></category>
		<category><![CDATA[Effects]]></category>

		<guid isPermaLink="false">http://th30z.netsons.org/?p=834</guid>
		<description><![CDATA[Alan has asked my How I&#8217;ve implemented the Touch and Rotate feature of the Moko. The answer is very simple, It&#8217;s all Magic! There&#8217;re very few lines of code to do it, because all the magic is made by atan2.
Atan2 is a variation of the arctangent function. For any real arguments x and y not [...]]]></description>
			<content:encoded><![CDATA[<p>Alan has asked my How I&#8217;ve implemented the Touch and Rotate feature of the Moko. The answer is very simple, It&#8217;s all Magic! There&#8217;re very few lines of code to do it, because all the magic is made by <a title="Atan2" href="http://en.wikipedia.org/wiki/Atan2">atan2</a>.</p>
<p><em>Atan2 is a variation of the arctangent function. For any real arguments x and y not both equal to zero, atan2(y, x) is the angle in radians between the positive x-axis of a plane and the point given by the coordinates (x, y) on it.</em></p>
<p><a href="http://th30z.netsons.org/wp-content/uploads/qttouchandrotate.png"><img class="aligncenter size-full wp-image-835" title="Qt Touch and Rotate" src="http://th30z.netsons.org/wp-content/uploads/qttouchandrotate.png" alt="Qt Touch and Rotate" width="312" height="318" /></a></p>
<p>The Source Code is available here: <a title="Qt Touch and Rotate Source Code" href="http://th30z.netsons.org/wp-content/uploads/qttouchandrotate.zip">Qt4 Touch and Rotate Source Code</a>.</p>
<p style="text-align: right;"><em>OT: PyCon3 (Italia) starts Tomorrow!</em></p>
]]></content:encoded>
			<wfw:commentRss>http://th30z.netsons.org/2009/05/qt4-touch-and-rotate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Qt4 JSON Stream Reader</title>
		<link>http://th30z.netsons.org/2009/05/qt4-json-stream-reader/</link>
		<comments>http://th30z.netsons.org/2009/05/qt4-json-stream-reader/#comments</comments>
		<pubDate>Sat, 02 May 2009 09:00:43 +0000</pubDate>
		<dc:creator>Matteo Bertozzi</dc:creator>
				<category><![CDATA[Qt4]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[Parser]]></category>

		<guid isPermaLink="false">http://th30z.netsons.org/?p=821</guid>
		<description><![CDATA[JSON, short for JavaScript Object Notation, is a lightweight computer data interchange format. It is a text-based, human-readable format for representing simple data structures and associative arrays (called objects).
One way to use JSON with Qt4 is using the QScriptEngine (engine.Evaluate(jsonSource)), But I like Reinventing the wheel, so I&#8217;ve written a simple JSON Stream Reader that [...]]]></description>
			<content:encoded><![CDATA[<p><em><a title="JSON Wiki" href="http://en.wikipedia.org/wiki/JSON">JSON</a>, short for JavaScript Object Notation, is a lightweight computer data interchange format. It is a text-based, human-readable format for representing simple data structures and associative arrays (called objects).</em></p>
<p>One way to use JSON with Qt4 is using the QScriptEngine (<em>engine.Evaluate(jsonSource)</em>), But I like Reinventing the wheel, so I&#8217;ve written a simple JSON Stream Reader that works &#8220;almost&#8221; like the QXmlStreamReader.</p>
<p>You&#8217;ve a readNext() method that read the next token and returns its type, and two properties name() and values() that Returns the name of the Property, Object or Array and the Value of the Property in a QVariant that can be Bool, Int, Double or String.</p>
<p>Below there&#8217;s an Example of How to use the JSON Stream Reader. Maybe you can use it to create an automatic Object Mapper like the <a href="http://th30z.netsons.org/2009/04/qt4-xml-objec-mapper/">Xml Object Mapper</a> that I&#8217;ve posted a couple of weeks ago.<br />
<code></p>
<pre>
QFile file(&quot;test.json&quot;);
if (!file.open(QIODevice::ReadOnly)) {
   qDebug() &lt;&lt; file.errorString();
   return(1);
}

THJsonStreamReader reader(&amp;file);
while (!reader.atEnd()) {
   switch (reader.readNext()) {
      case THJsonStreamReader::PropertyNumerical:
         qDebug() &lt;&lt; &quot; - Property Numerical&quot; &lt;&lt; reader.name() &lt;&lt; reader.value();
         break;
      case THJsonStreamReader::PropertyString:
         qDebug() &lt;&lt; &quot; - Property String&quot; &lt;&lt; reader.name() &lt;&lt; reader.value();
         break;
      case THJsonStreamReader::PropertyFalse:
         qDebug() &lt;&lt; &quot; - Property False&quot; &lt;&lt; reader.name() &lt;&lt; reader.value();
         break;
      case THJsonStreamReader::PropertyTrue:
         qDebug() &lt;&lt; &quot; - Property True&quot; &lt;&lt; reader.name() &lt;&lt; reader.value();
         break;
      case THJsonStreamReader::PropertyNull:
         qDebug() &lt;&lt; &quot; - Property Null&quot; &lt;&lt; reader.name();
         break;
      case THJsonStreamReader::Object:
         qDebug() &lt;&lt; &quot;Object&quot; &lt;&lt; reader.name();
         break;
      case THJsonStreamReader::ObjectEnd:
         qDebug() &lt;&lt; &quot;Object End&quot;;
         break;
      case THJsonStreamReader::Array:
         qDebug() &lt;&lt; &quot;Array&quot; &lt;&lt; reader.name();
         break;
      case THJsonStreamReader::ArrayEnd:
         qDebug() &lt;&lt; &quot;Array End&quot;;
         break;
   }
}

file.close();
</pre>
<p></code></p>
<p>The Source Code is Available Here: <a href="http://th30z.netsons.org/wp-content/uploads/qtjsonstreamreader.zip">Qt4 JSON Stream Reader Source Code</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://th30z.netsons.org/2009/05/qt4-json-stream-reader/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Qt4 Google Authentication</title>
		<link>http://th30z.netsons.org/2009/05/qt4-google-authentication/</link>
		<comments>http://th30z.netsons.org/2009/05/qt4-google-authentication/#comments</comments>
		<pubDate>Fri, 01 May 2009 11:53:11 +0000</pubDate>
		<dc:creator>Matteo Bertozzi</dc:creator>
				<category><![CDATA[Qt4]]></category>
		<category><![CDATA[Google Services]]></category>

		<guid isPermaLink="false">http://th30z.netsons.org/?p=815</guid>
		<description><![CDATA[Today, I&#8217;m looking at Google services, Contacts, Maps, Search&#8230; to use all this service in your app you need to get The Authentication Token (see the Google Auth For Installed Apps page). So, I&#8217;ve implemented a simple class to do this.


QEventLoop q;
THGoogleAuth gAuth(&#34;MYNAME@gmail.com&#34;);
QObject::connect(&#38;gAuth, SIGNAL(authenticated()), &#38;q, SLOT(quit()));
gAuth.login(THGoogleAuth::Contacts, &#34;MYPASSWORD&#34;);
q.exec();

if (gAuth.error() == THGoogleAuth::NoError) {
    qDebug() [...]]]></description>
			<content:encoded><![CDATA[<p>Today, I&#8217;m looking at Google services, Contacts, Maps, Search&#8230; to use all this service in your app you need to get The Authentication Token (see the <a title="Google Auth for Installed Apps" href="http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html">Google Auth For Installed Apps</a> page). So, I&#8217;ve implemented a simple class to do this.<br />
<code></p>
<pre>
QEventLoop q;
THGoogleAuth gAuth(&quot;MYNAME@gmail.com&quot;);
QObject::connect(&amp;gAuth, SIGNAL(authenticated()), &amp;q, SLOT(quit()));
gAuth.login(THGoogleAuth::Contacts, &quot;MYPASSWORD&quot;);
q.exec();

if (gAuth.error() == THGoogleAuth::NoError) {
    qDebug() &lt;&lt; &quot;SID&quot; &lt;&lt; gAuth.sid();
    qDebug() &lt;&lt; &quot;LSID&quot; &lt;&lt; gAuth.lsid();
    qDebug() &lt;&lt; &quot;AUTH&quot; &lt;&lt; gAuth.auth();
} else {
    qDebug() &lt;&lt; gAuth.errorString();
}
</pre>
<p></code></p>
<p>The Source Code is Available Here: <a title="Qt4 Google Auth Source Code" href="http://th30z.netsons.org/wp-content/uploads/qtgoogleauth.zip">Qt4 Google Auth Source Code</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://th30z.netsons.org/2009/05/qt4-google-authentication/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Qt4 Line Graph</title>
		<link>http://th30z.netsons.org/2009/04/qt4-line-graph/</link>
		<comments>http://th30z.netsons.org/2009/04/qt4-line-graph/#comments</comments>
		<pubDate>Sat, 25 Apr 2009 16:14:58 +0000</pubDate>
		<dc:creator>Matteo Bertozzi</dc:creator>
				<category><![CDATA[Qt4]]></category>

		<guid isPermaLink="false">http://th30z.netsons.org/?p=792</guid>
		<description><![CDATA[Just back from Bike Trip, It&#8217;s always inspiring&#8230; In the last minutes, I&#8217;ve written a quick Qt Line Graph demo that maybe I&#8217;ll use in the my next Project, if I find a bit of time.
The code is far (far, far, far&#8230;) from perfect but is enough for a Test/Demo  

The Source code is [...]]]></description>
			<content:encoded><![CDATA[<p>Just back from Bike Trip, It&#8217;s always inspiring&#8230; In the last minutes, I&#8217;ve written a quick <strong>Qt Line Graph demo</strong> that maybe I&#8217;ll use in the my next Project, if I find a bit of time.</p>
<p>The code is far (far, far, far&#8230;) from perfect but is enough for a Test/Demo <img src='http://th30z.netsons.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://th30z.netsons.org/wp-content/uploads/qtlineargraph.png"></a><a href="http://th30z.netsons.org/wp-content/uploads/qtlineargraph.png"><img class="aligncenter size-full wp-image-798" title="Qt4 Linear Graph" src="http://th30z.netsons.org/wp-content/uploads/qtlineargraph.png" alt="Qt4 Linear Graph" width="546" height="319" /></a></p>
<p>The Source code is available here: <a title="Qt4 Line Graph Source Code" href="http://th30z.netsons.org/wp-content/uploads/qtlinegraph.zip">Qt4 Line Graph Source Code</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://th30z.netsons.org/2009/04/qt4-line-graph/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Qt4 Xml Object Mapper</title>
		<link>http://th30z.netsons.org/2009/04/qt4-xml-objec-mapper/</link>
		<comments>http://th30z.netsons.org/2009/04/qt4-xml-objec-mapper/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 08:28:46 +0000</pubDate>
		<dc:creator>Matteo Bertozzi</dc:creator>
				<category><![CDATA[Qt4]]></category>

		<guid isPermaLink="false">http://th30z.netsons.org/?p=736</guid>
		<description><![CDATA[I&#8217;m looking at Google App Engine, to realize my Web Services (Obviously with Python). Web Service Response are generally in XML, and in the 90% of the case you&#8217;ll need to map Xml Response with your Objects.
I&#8217;ve written a simple class that allows you to handle this task in a easy way, and with a [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m looking at Google App Engine, to realize my Web Services (Obviously with Python). Web Service Response are generally in XML, and in the 90% of the case you&#8217;ll need to map Xml Response with your Objects.<br />
I&#8217;ve written a simple class that allows you to handle this task in a easy way, and with a quite good flexibility.<br />
<code></p>
<pre>
class TestObject : public QObject {
   Q_OBJECT

   Q_PROPERTY(QString surname READ surname WRITE setSurname)
   Q_PROPERTY(QUrl website READ website WRITE setWebSite)
   Q_PROPERTY(QString name READ name WRITE setName)
   Q_PROPERTY(int age READ age WRITE setAge)

   ...
};
</pre>
<p></code><br />
The First step is writing Objects that inherit from QObject and adding your properties. <em>The Mapper uses the introspection to assign the values</em>. </p>
<p>Mapping and Introspection: Maybe you don&#8217;t like the Xml Node Name as your property&#8217;s name, in this case you can use the HashMap that allows you to say &#8220;Hei, the TagName &#8216;A&#8217; is the property &#8216;foo&#8217;!&#8221;. There&#8217;s also a protected virtual method called convertData that tries to covert Xml Node Text Value to your property&#8217;s type, take a look at this example.<br />
<code></p>
<pre>
QString xml = "&lt;personInfo&gt;"
                   "&lt;age&gt;21&lt;/age&gt;"
                   "&lt;personName&gt;Matteo&lt;/personName&gt;"
                   "&lt;surname&gt;Bertozzi&lt;/surname&gt;"
                   "&lt;personWeb&gt;http://th30z.netsons.org/&lt;/personWeb&gt;"
               "&lt;/personInfo&gt;";

THXmlHashMap dataMapping;
dataMapping.insert("personName", "name");
dataMapping.insert("personWeb", "website");

TestObject obj;
THXmlMapper xmlMapper(&#038;obj);
xmlMapper.setMapping(dataMapping);
xmlMapper.map(xml);
qDebug() &lt;&lt; obj.name() &lt;&lt; obj.surname() &lt;&lt; obj.age() &lt;&lt; obj.website();
</pre>
<p></code></p>
<p>Source Code is Available Here: <a href="http://th30z.netsons.org/wp-content/uploads/qtxmlmapper.zip">Qt4 Xml Object Mapper</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://th30z.netsons.org/2009/04/qt4-xml-objec-mapper/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Qt4 PageFlow</title>
		<link>http://th30z.netsons.org/2009/04/qt4-pageflow/</link>
		<comments>http://th30z.netsons.org/2009/04/qt4-pageflow/#comments</comments>
		<pubDate>Sat, 11 Apr 2009 09:39:12 +0000</pubDate>
		<dc:creator>Matteo Bertozzi</dc:creator>
				<category><![CDATA[Qt4]]></category>
		<category><![CDATA[Effects]]></category>

		<guid isPermaLink="false">http://th30z.netsons.org/?p=723</guid>
		<description><![CDATA[Just another example that I don&#8217;t have finished last Sunday. This is a simple widget that tries to be similar at the iPhone Mobile Safari Tabs Page. It&#8217;s a really nice concept used also by Palm Pre to display the running apps. To switch  item  swipe left or right (Press Mouse Button, Move mouse [...]]]></description>
			<content:encoded><![CDATA[<p>Just another example that I don&#8217;t have finished last Sunday. This is a simple widget that tries to be similar at the iPhone Mobile Safari Tabs Page. It&#8217;s a really nice concept used also by Palm Pre to display the running apps. To switch  item  swipe left or right (Press Mouse Button, Move mouse in a specified direction and Release it).</p>
<p><a href="http://th30z.netsons.org/wp-content/uploads/qtpageflow.png"><img class="aligncenter size-full wp-image-724" title="QtPageFlow" src="http://th30z.netsons.org/wp-content/uploads/qtpageflow.png" alt="QtPageFlow" width="536" height="428" /></a></p>
<p>Source code is available here: <a title="Qt4 PageFlow Source Code" href="http://th30z.netsons.org/wp-content/uploads/qtpageflow.zip">Qt4 PageFlow Source Code</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://th30z.netsons.org/2009/04/qt4-pageflow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
