<?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>The ForwardBias Blog &#187; Qt</title>
	<atom:link href="http://blog.forwardbias.in/category/qt/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.forwardbias.in</link>
	<description>The Official Blog of ForwardBias Technologies</description>
	<lastBuildDate>Mon, 19 Dec 2011 04:11:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Qt Quick Best Practices</title>
		<link>http://blog.forwardbias.in/2011/12/qt-quick-best-practices.html</link>
		<comments>http://blog.forwardbias.in/2011/12/qt-quick-best-practices.html#comments</comments>
		<pubDate>Mon, 19 Dec 2011 04:10:47 +0000</pubDate>
		<dc:creator>girish</dc:creator>
				<category><![CDATA[KDE]]></category>
		<category><![CDATA[Qt]]></category>
		<category><![CDATA[girish]]></category>

		<guid isPermaLink="false">http://blog.forwardbias.in/?p=356</guid>
		<description><![CDATA[I noticed that the video and slides for my Qt Dev Days 2011 talk in Munich are now online. Here&#8217;s the video and here are the slides.
I couldn&#8217;t attend the event in San Francisco because I had to attend to some personal matters. Johannes and Donald covered for me there on very short notice (thanks [...]]]></description>
			<content:encoded><![CDATA[<p>I noticed that the video and slides for my Qt Dev Days 2011 talk in Munich are now online. Here&#8217;s the <a href="http://developer.qt.nokia.com/videos/watch/qt-quick-best-practices-and-design-patterns">video</a> and here are the <a href="http://get.qt.nokia.com/videos/DevDays2011/TechnicalSessions/DevDays2011_-_Qt_Quick_Best_Practices_And_Design_Patterns.pdf">slides</a>.</p>
<p>I couldn&#8217;t attend the event in San Francisco because I had to attend to some personal matters. Johannes and Donald covered for me there on very short notice (thanks guys!). For that matter, I have been mostly &#8216;offline&#8217; for the last 2 months or so and will continue to be offline for atleast end of this month. So, if you sent me mail, I will get back at some point <img src='http://blog.forwardbias.in/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.forwardbias.in/2011/12/qt-quick-best-practices.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Qt DevDays 2011</title>
		<link>http://blog.forwardbias.in/2011/10/qt-devdays-2011.html</link>
		<comments>http://blog.forwardbias.in/2011/10/qt-devdays-2011.html#comments</comments>
		<pubDate>Fri, 21 Oct 2011 14:34:11 +0000</pubDate>
		<dc:creator>girish</dc:creator>
				<category><![CDATA[KDE]]></category>
		<category><![CDATA[Qt]]></category>
		<category><![CDATA[girish]]></category>

		<guid isPermaLink="false">http://blog.forwardbias.in/?p=340</guid>
		<description><![CDATA[I am just about to catch my flight to Munich to attend Qt Developer Days 2011 where I will be giving a talk on Qt Quick Best Practices. I have been working with QML exclusively for over a year now and this talk is in essence a summary of all the things I have learnt [...]]]></description>
			<content:encoded><![CDATA[<p>I am just about to catch my flight to Munich to attend <a href="http://qt.nokia.com/qtdevdays2011/">Qt Developer Days</a> 2011 where I will be giving a talk on <a href="http://qt.nokia.com/qtdevdays2011/qt-technical-sessions#qtbestpractices">Qt Quick Best Practices</a>. I have been working with QML exclusively for over a year now and this talk is in essence a summary of all the things I have learnt about it. This will also be my 6th developer days as attendee and third time as a speaker.</p>
<p>Am really looking forward to interesting conversations about Qt5, Qt Quick and the <a href="http://labs.qt.nokia.com/2011/10/21/the-qt-project-is-live/">Qt project</a> <img src='http://blog.forwardbias.in/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.forwardbias.in/2011/10/qt-devdays-2011.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>When sqlite queries fail for no reason</title>
		<link>http://blog.forwardbias.in/2011/08/when-sqlite-queries-fail-for-no-reason.html</link>
		<comments>http://blog.forwardbias.in/2011/08/when-sqlite-queries-fail-for-no-reason.html#comments</comments>
		<pubDate>Sat, 20 Aug 2011 04:47:33 +0000</pubDate>
		<dc:creator>girish</dc:creator>
				<category><![CDATA[KDE]]></category>
		<category><![CDATA[Qt]]></category>
		<category><![CDATA[girish]]></category>

		<guid isPermaLink="false">http://blog.forwardbias.in/?p=329</guid>
		<description><![CDATA[If you have worked with QtSql, you might have hit the dreaded &#8220;Parameter count mismatch&#8221; for your perfectly valid SQL query. The problem is excruciatingly hard to debug because the query itself works perfectly fine with the sqlite3 tool.
Here&#8217;s the solution: Compile Qt with -system-sqlite.
The problem: Qt uses it&#8217;s own sqlite3 headers under src/3rdparty by [...]]]></description>
			<content:encoded><![CDATA[<p>If you have worked with QtSql, you might have hit the dreaded &#8220;Parameter count mismatch&#8221; for your perfectly valid SQL query. The problem is excruciatingly hard to debug because the query itself works perfectly fine with the sqlite3 tool.</p>
<p>Here&#8217;s the solution: Compile Qt with -system-sqlite.</p>
<p>The problem: Qt uses it&#8217;s own sqlite3 headers under src/3rdparty by default which are completely out of date. Qt 4.7 has sqlite3 header from 2009-10-14 version 3.6.18. Almost 2 years old and current sqlite version is 3.7.7! That&#8217;s like using Qt 4.5.3 in 2011 <img src='http://blog.forwardbias.in/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />   FTS3/4 table queries fail consistently when using Qt&#8217;s own headers.</p>
<p>I have opened <a href="https://bugreports.qt.nokia.com/browse/QTBUG-21040">QTBUG-21040</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.forwardbias.in/2011/08/when-sqlite-queries-fail-for-no-reason.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>On WebKit and WebKit2</title>
		<link>http://blog.forwardbias.in/2011/08/on-webkit-and-webkit2.html</link>
		<comments>http://blog.forwardbias.in/2011/08/on-webkit-and-webkit2.html#comments</comments>
		<pubDate>Tue, 09 Aug 2011 07:18:49 +0000</pubDate>
		<dc:creator>girish</dc:creator>
				<category><![CDATA[KDE]]></category>
		<category><![CDATA[Qt]]></category>
		<category><![CDATA[girish]]></category>

		<guid isPermaLink="false">http://blog.forwardbias.in/?p=318</guid>
		<description><![CDATA[Ever heard of WebKit2 and wondering what it means from a Qt perspective? Here&#8217;s an attempt to explain QtWebKit and QtWebKit2 in simple terms. I make no attempt to be completely technically correct, it&#8217;s meant to be able to explain terminology to the WebKit uninitiated.
In WebKit lingo, &#8220;WebCore&#8221; is the thing that takes of parsing/layouting/rendering [...]]]></description>
			<content:encoded><![CDATA[<p>Ever heard of WebKit2 and wondering what it means from a Qt perspective? Here&#8217;s an attempt to explain QtWebKit and QtWebKit2 in simple terms. I make no attempt to be completely technically correct, it&#8217;s meant to be able to explain terminology to the WebKit uninitiated.</p>
<p>In WebKit lingo, &#8220;WebCore&#8221; is the thing that takes of parsing/layouting/rendering of various css/svg/html documents, providing DOM bindings etc. &#8220;JavaScriptCore&#8221; implements JavaScript support and is also referred to as SFX (Squirrel fish Extreme). JavaScriptCore can be used as a stand alone JavaScript engine and has no dependencies on WebCore. WebCore uses JavaScriptCore to support JavaScript in web pages. WebCore also contains support for NPAPI plugins (like flash). &#8220;WebKit&#8221; uses the WebCore to build a platform/toolkit specific API. For example, the Qt &#8220;WebKit&#8221; port provides <a href="http://doc.qt.nokia.com/4.7-snapshot/qwebelement.html">QWebElement</a> which exposes the WebCore&#8217;s DOM. By definition, WebKit is platform/toolkit/port specific. The Qt port is simply called QtWebKit.</p>
<p>The QtWebKit port is released periodically independent of Qt releases. These ports have the number QtWebKit 2.0, QtWebKit 2.1, QtWebKit 2.2 etc. QtWebKit 2.0 is identical to what was shipped with Qt 4.7.0. QtWebKit 2.1, intended to be mobile friendly, is not part of any shipping Qt release. QtWebKit 2.2, which will be shipped as part of the upcoming Qt 4.8.0, is yet to be released.</p>
<p>Now for WebKit2. The first and most important thing you should know about WebKit2 (even before you know what WebKit2 is) is that WebKit2 is NEITHER AN UPGRADE NOR A NEWER RELEASE of WebKit. It is a parallel port that can happily co-exist with &#8220;WebKit&#8221;. Let me reiterate: Stop trying to think of WebKit2 as WebKit version 2 <img src='http://blog.forwardbias.in/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  Think of it as a completely different API from existing WebKit.</p>
<p>WebKit is the traditional in-process renderer. If you create 100 web pages, they all reside in one process. If one page causes a crash, it brings everything down. WebKit2 provides a system and an API to make it possible to render a page in a separate process. The process management is taken care of by WebKit2. The actual rendering of the page happens using WebCore. WebKit2, therefore, spawns out processes, renders pages in these processes and makes the end result available to the application. It provides mechanisms deliver events from the application to the rendering process. The Qt port of WebKit2 is simply called QtWebKit2. QtWebKit2 is what is used in the N9 browser.</p>
<p>White-space has never been more important. QtWebKit 2.x is a completely different beast from QtWebKit2. QtWebKit 2.x is plain old QtWebKit releases. QtWebKit2 is Qt&#8217;s port of WebKit2. This unfortunate naming is a result of Apple announcing WebKit2 shortly after the Qt guys deciding to call their releases QtWebKit 2.x.</p>
<p>WebKit2 and Chromium are similar in their goal. Chromium does not use WebKit2 and probably never will. The Chromium code was intended for the chromium browser specifically. The WebKit2 code was designed upfront to be an API. This difference in motivation resulted in different implementations. See <a href="http://trac.webkit.org/wiki/WebKit2">this page</a> for more details.</p>
<p>Because of the multi-process nature of QtWebKit2, many APIs that existed in QtWebKit simply don&#8217;t exist anymore. WebKit2 design lends itself to an asynchronous API compared to WebKit where most API was synchronous. For example, DOM introspection of web pages using QWebElement is not possible since the web page&#8217;s DOM resides in another process.</p>
<p>QtWebKit2 has a hard dependency on Qt5 and is very much a moving target like Qt5. QtWebKit will probably not work well with Qt5, we have to wait and see.</p>
<p><strong>Current status: </strong> Nokia&#8217;s Qt WebKit team has decided to focus on QtWebKit2. They have decided to pass on maintainership of QtWebKit to <a href="https://lists.webkit.org/pipermail/webkit-dev/2011-July/017460.html">someone else</a>. At the time of writing, there is no publicly announced appointed maintainer to QtWebKit.</p>
<p>Update: Mentioned about QtWebKit 2.x releases based on Jocelyn&#8217;s comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.forwardbias.in/2011/08/on-webkit-and-webkit2.html/feed</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Qt/Caca Lighthouse Plugin</title>
		<link>http://blog.forwardbias.in/2011/07/qtcaca-lighthouse-plugin.html</link>
		<comments>http://blog.forwardbias.in/2011/07/qtcaca-lighthouse-plugin.html#comments</comments>
		<pubDate>Mon, 18 Jul 2011 11:05:42 +0000</pubDate>
		<dc:creator>girish</dc:creator>
				<category><![CDATA[KDE]]></category>
		<category><![CDATA[Qt]]></category>
		<category><![CDATA[girish]]></category>

		<guid isPermaLink="false">http://blog.forwardbias.in/?p=307</guid>
		<description><![CDATA[
At the Qt Contributors Summit, Johannes&#8216; showed me his Qt/Caca Lighthouse plugin. Caca is a graphics library to output text instead of pixels. So this plugin lets you run Qt programs on the console  
His code needed some love, so I forked it and cleaned it up. Caca does not provide a event fd [...]]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-309" title="lighthouse_ascii" src="http://blog.forwardbias.in/wp-content/uploads/2011/07/lighthouse_ascii.png" alt="lighthouse_ascii" width="384" height="675" /></p>
<p>At the Qt Contributors Summit, <a href="https://gitorious.org/~nebulon">Johannes</a>&#8216; showed me his Qt/Caca Lighthouse plugin. <a href="http://caca.zoy.org/wiki/libcaca">Caca</a> is a graphics library to output text instead of pixels. So this plugin lets you run Qt programs on the console <img src='http://blog.forwardbias.in/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>His code needed some love, so I forked it and cleaned it up. Caca does not provide a event fd and so we have to keep polling caca for events. Since this wasn&#8217;t ideal, I moved the event handling to a separate thread and blocked for events. Unfortunately, I found that the caca library is not thread-safe and rendering and processing events in separate threads makes caca crash at randomly. So, I ended up moving the rendering to the event processing thread and having to resurrect the 20ms event timer again <img src='http://blog.forwardbias.in/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' />  The cool thing though is that now Qt renders to QImage in the main ui thread and hands it off to caca. Caca opens a X connection (or similar), converts the image into text, displays a window and handles events in another thread. With some refactoring and thanks to QMetaObject::invokeMethod, the threaded and non-threaded rendering are pretty much the same and can be switched using an environment variable (THREADED_CACA=1).</p>
<p><a href="http://www.youtube.com/watch?v=ZJyF99uqSbY">Animated tiles</a>:<br />
<iframe width="425" height="349" src="http://www.youtube.com/embed/ZJyF99uqSbY?hl=en&#038;fs=1" frameborder="0" allowfullscreen></iframe></p>
<p>If you want to hack further, code is on <a href="https://qt.gitorious.org/~girish/qt/caca-lighthouse">gitorious</a>. (Caca doesn&#8217;t seem to deliver gpm events with ncurses, so that would be a nice fix to have)</p>
<p><strong>Update</strong>: Welcome <a href="http://it.slashdot.org/story/11/07/19/177243/Qt-For-the-Console">slashdot</a> readers</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.forwardbias.in/2011/07/qtcaca-lighthouse-plugin.html/feed</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Qt Contributors&#8217; Summit</title>
		<link>http://blog.forwardbias.in/2011/06/qt-contributors-summit.html</link>
		<comments>http://blog.forwardbias.in/2011/06/qt-contributors-summit.html#comments</comments>
		<pubDate>Wed, 15 Jun 2011 15:14:58 +0000</pubDate>
		<dc:creator>girish</dc:creator>
				<category><![CDATA[Qt]]></category>
		<category><![CDATA[girish]]></category>

		<guid isPermaLink="false">http://blog.forwardbias.in/?p=303</guid>
		<description><![CDATA[Up until 3 hours back, I wasn&#8217;t intending to attend QCS since my visa was expected to arrive late. We have 15 working days waiting period here just to get to the visa interview phase. My tickets were booked for the 19th June to Berlin nevertheless for a Qt Media Hub hackfest. I attended the [...]]]></description>
			<content:encoded><![CDATA[<p>Up until 3 hours back, I wasn&#8217;t intending to attend QCS since my visa was expected to arrive late. We have 15 working days waiting period here just to get to the visa interview phase. My tickets were booked for the 19th June to Berlin nevertheless for a Qt Media Hub hackfest. I attended the visa interview yesterday and mentioned that it would be great if they could give me visa for the 16th Jun. They wanted rebooked hotel and plane booking in under 20 mins and a german invite (The english invite left them wondering why a certain Alexandra from Oslo is inviting me to a conference in Germany)! The only internet parlor I found nearby was hopeless and I returned back home.</p>
<p>Incredibly, the German consulate was kind enough to not only send me my visa a couple of hours of back but they also gave me a visa starting from 16th June! With very many things working to my favor (like just a 100 EUR rescheduling fee for the ticket), I am very happy to say I will arrive on 16th afternoon!</p>
<div id="attachment_305" class="wp-caption aligncenter" style="width: 206px"><img class="size-full wp-image-305" title="QCS" src="http://blog.forwardbias.in/wp-content/uploads/2011/06/summit_01.png" alt="Qt Contributors' summit" width="196" height="121" /><p class="wp-caption-text">Qt Contributors&#39; summit</p></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.forwardbias.in/2011/06/qt-contributors-summit.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Publishing Symbian apps to Ovi &#8211; a quick howto</title>
		<link>http://blog.forwardbias.in/2011/04/publishing-symbian-apps-to-ovi.html</link>
		<comments>http://blog.forwardbias.in/2011/04/publishing-symbian-apps-to-ovi.html#comments</comments>
		<pubDate>Mon, 11 Apr 2011 08:52:48 +0000</pubDate>
		<dc:creator>roop</dc:creator>
				<category><![CDATA[Qt]]></category>
		<category><![CDATA[ovi]]></category>
		<category><![CDATA[roop]]></category>
		<category><![CDATA[symbian]]></category>

		<guid isPermaLink="false">http://blog.forwardbias.in/?p=262</guid>
		<description><![CDATA[I was trying to publish an app to Ovi last month using Nokia&#8217;s free signing service (the Nokia-recommended way), and was a little confused with instructions spread across different sites and with different approaches. I mailed Ovi Publish to understand the process better. (Thanks to Kevin from Ovi Publish for patiently answering all my questions.) [...]]]></description>
			<content:encoded><![CDATA[<p>I was trying to publish an app to Ovi last month using Nokia&#8217;s free signing service (the Nokia-recommended way), and was a little confused with instructions spread across different sites and with different approaches. I mailed Ovi Publish to understand the process better. (Thanks to Kevin from Ovi Publish for patiently answering all my questions.) From my experience, here&#8217;s a one-page howto on Publishing to Ovi.</p>
<p>You can use these instructions if you:</p>
<ul>
<li>Want to publish a Qt app for a Nokia Symbian device to the Ovi Store</li>
<li>Do not use any of these in TARGET.CAPABILITY in your pro file: NetworkControl, MultimediaDD, CommDD, DiskAdmin, AllFiles, DRM and TCB</li>
<li>Have Nokia Qt SDK 1.0 (with <a href="http://wiki.forum.nokia.com/index.php/Nokia_Smart_Installer_for_Symbian">Smart Installer</a>) or Qt SDK 1.1 (beta/pre-release) in Windows platform to build the release executable</li>
<li>Have 1 euro to spare on your credit card</li>
</ul>
<p><strong>Pre-submission instructions:</strong><br />
<em>(Start on this at least 4 days before your app&#8217;s coding/testing is expected to complete)</em></p>
<p>1. Go to publish.ovi.com and register yourself (it&#8217;ll cost you 1 euro)</p>
<p>2. Make a request for Nokia UIDs by sending an email to <a href="mailto:publishtoovi.support@nokia.com">publishtoovi.support@nokia.com</a> with the following information:</p>
<ul>
<li>your Ovi Publish login id</li>
<li>the company name under which you registered for Ovi Publish (if any)</li>
<li><a href="http://en.wikipedia.org/wiki/International_Mobile_Equipment_Identity">IMEI</a> numbers of devices (upto 5) you intend to use for testing the app</li>
</ul>
<p>3. You should receive a reply from Ovi Publish with a Terms and Conditions pdf (something like <a href="https://p.d.ovi.com/p/g/ovistore_static/docs/Symbian_Signed_for_Ovi_Store_Publishers.pdf">this</a> (pdf)), asking you to print it, sign (or get signed by a company representative), scan and email that back to them. Sign on and scan all pages.</p>
<p>4. Once you email them the scan, you should receive the following:</p>
<ul>
<li>Five 8-digit hexadecimal numbers: Nokia UIDs (you can publish exactly one app with each UID)</li>
<li>Three files (probably in a zip archive): &lt;something&gt;.cer, &lt;something&gt;.key and &lt;somethingelse&gt;.sis</li>
</ul>
<p>5. Specify the version number of your app in the .pro file.</p>
<blockquote>
<pre>VERSION = 1.0.0</pre>
</blockquote>
<p>6. Create an icon for your app (256&#215;256 pixels, PNG format) to be shown in the phone&#8217;s applications menu. Update your .pro file with a path to the icon.</p>
<blockquote>
<pre>symbian:ICON = icon.png</pre>
</blockquote>
<p><small>(Warning: Using PNGs as icon is undocumented afaik, but works. We&#8217;re <a href="http://doc.qt.nokia.com/appicon.html">supposed to use</a> Tiny SVGs but the svgs I created out of Inkscape didn&#8217;t work &#8211; maybe they weren&#8217;t &#8220;tiny&#8221; enough.)</small></p>
<p>7. Identify the Symbian versions/devices you&#8217;re targeting the app for. If you support all Symbian versions, you can skip this step. If you support only Symbian^1 and ^3 (like me), include the following in your .pro file:</p>
<blockquote>
<pre>symbian {
  supported_platforms = \
    "[0x1028315F],0,0,0,{\"S60ProductID\"}" \ # only Symbian^1
    "[0x20022E6D],0,0,0,{\"S60ProductID\"}"   # and Symbian^3
  # remove default platforms
  default_deployment.pkg_prerules -= pkg_platform_dependencies
  # add our platforms
  platform_deploy.pkg_prerules += supported_platforms
  DEPLOYMENT += platform_deploy
}</pre>
</blockquote>
<p>For including support for other Symbian versions, pickup the appropriate hex codes from <a href="http://wiki.forum.nokia.com/index.php/S60_Platform_and_device_identification_codes#S60_Platform_Identification">here</a>. If a user tries to install the app in a version of Symbian not specified in the list, he will see a warning during installation (something like: &#8220;This software is not supported in this platform. Continue installation / Cancel?&#8221;).</p>
<p>8. Include the vendor name in the .pro file. (If you specified a company name in step 2, the vendor name should be the company name. Else, the vendor name can be the name of the author of the app.)</p>
<blockquote>
<pre>symbian {
  vendorinfo = "%{\"InsertVendorNameHere\"}" \
                      ":\"InsertVendorNameHere\""
  vendor_deploy.pkg_prerules += vendorinfo
  DEPLOYMENT += vendor_deploy
}</pre>
</blockquote>
<p><strong>Submission instructions:</strong><br />
<em>(Start on this after your app&#8217;s coding/testing is complete.)</em></p>
<p>9. Create a screenshot of the app. You can get it by PrintScreen-ing on Qt Simulator running at phone resolution. But in case your app doesn&#8217;t work well on the simulator (like mine), you can temporarily hack your QMainWindow to draw itself to a file on the device.</p>
<blockquote>
<pre>MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
{
    ...
    // grab a screenshot 5 secs after startup
    QTimer::singleShot(5000, this, SLOT(getScreenshot()));
}

void MainWindow::getScreenshot()
{
    QPixmap pixmap = QPixmap::grabWidget(this);
    pixmap.save("E:/app_screenshot.png", "PNG");
    qDebug() &lt;&lt; "Saved screenshot";
}</pre>
</blockquote>
<p>One way to transfer this image from your phone to your PC is to choose <em>Connectivity &gt; USB &gt; Mass storage</em> in the phone and then connect the phone to the PC by USB cable.</p>
<p>Ovi accepts only square images as screenshots (why that is the case when my phone doesn&#8217;t have a square screen is one of those life&#8217;s little mysteries). So open up the screenshot in your favourite image editor (Gimp or Inkscape or MS Paint or whatever) and cut out a square portion or add a square background (256&#215;256 or bigger, PNG or JPG format).</p>
<p>10. You now have two options to create the .sis file for submission to Ovi Publish. Option A is dead simple, but needs you to have a very recent Qt Creator. Option B is a tad complexer, but is also nicer as it lets us try out the .sis file before submission. Make your pick.</p>
<p>Option A:</p>
<ol style="list-style-type: lower-roman">
<li>Check your Qt Creator&#8217;s version (in Windows, where you will be compiling the app for shipping). If it&#8217;s anything less than 2.2.81, install the <a href="http://qt.nokia.com/developer/qt-snapshots/">latest bleeding-edge snapshot version</a>. (If you compile Qt Creator yourself from source, make sure you have <a title="Commit 8d781af in Qt Creator" href="http://qt.gitorious.org/qt-creator/qt-creator/commit/8d781af43b4fa0c5fb9b8161e8843ad3bfad10dc">commit 8d781af</a>).</li>
<li>Open your project in this uber-recent version of Qt Creator, select the <em>Symbian Device</em> build target. Choose <em>Build &gt; Publish Project</em> and follow instructions from the wizard that opens up.</li>
<li>In the wizard, change the Application UID field to one of the Nokia UIDs sent to you in step (4) by Ovi Publish.</li>
<li>Once you hit the <em>Commit</em> button in the wizard, you might have to wait a while until the <em>Open Containing Folder</em> button gets enabled. When it does, you can click that to pickup &lt;yourapp&gt;_installer.sis from that folder. Copy that file to someplace safe (maybe add it to your version control). This .sis is what you&#8217;ll be uploading to Ovi Publish. You cannot try out this .sis on the device, though.</li>
<li>During step iv, Qt Creator changes the TARGET.UID3 specified in your pro file. To continue testing the app on your device (during further development), you might want to revert the UID to the earlier value.</li>
</ol>
<p>Option B:</p>
<ol style="list-style-type: lower-roman">
<li>Change the TARGET.UID3 specified your .pro file to one of the Nokia UIDs sent to you in step (4) by Ovi Publish.</li>
<li>Open <em>Qt for Symbian Command Prompt</em> from the Windows start menu and run the following commands. Use the local path to the .cer and .key files you received in step (4).<br />
<blockquote>
<pre>make clean
rm *.pkg
rm *.sis
qmake
make release-gcce
make sis QT_SIS_CERTIFICATE=path/to/something.cer QT_SIS_KEY=path/to/something.key</pre>
</blockquote>
</li>
<li>Open &lt;yourapp&gt;_installer.pkg in a text editor. You should find something like:
<pre>#{"appname installer"},(0xA000D7CE),1,0,0</pre>
<p>where appname is the name of your app and 1,0,0 is the version number you specified in step (5). The UID has to be either 0&#215;2002CCCF or 0xA000D7CE. If it&#8217;s anything else, change the UID to 0&#215;2002CCCF.</li>
<li>You should also find a line specifying where it should get installed on the device:<br />
<blockquote>
<pre>"C:/path/in/dev/env/to/app/appname.sis" – "c:\private\2002CCCE\import\appname.sis"</pre>
</blockquote>
<p>Change the &#8220;c:\private\2002CCCE\import\&#8221; in the right hand side to &#8220;!:\private\2002CCCE\import\&#8221;. The &#8220;!&#8221; tells the Symbian packager to allow the user of the app to choose a drive during installation.</li>
<li>Go back to the open <em>Qt for Symbian Command Prompt</em> window and run:<br />
<blockquote>
<pre>make installer_sis QT_SIS_CERTIFICATE=path/to/something.cer QT_SIS_KEY=path/to/something.key</pre>
</blockquote>
<p>This creates a &lt;yourapp&gt;_installer.sis in the same folder. Copy that file to someplace safe (maybe add it to your version control). This .sis is what you&#8217;ll be uploading to Ovi Publish.</li>
<li>Pick a test device (whose IMEI you sent to Ovi Publish in step (2)), and install on it the .sis file you received in step (4).</li>
<li>You can now try out the &lt;yourapp&gt;_installer.sis on the test device. Apart from being able to make a test run of the actual binary you&#8217;re going to submit, you can get a feel for what the user experience would be during installation. (For eg., I noticed that the installation fails if there&#8217;s no internet, even if the device has the required version of Qt.) You can also make sure that your (or your company&#8217;s) name and the app&#8217;s version number are showing up correctly during installation.</li>
</ol>
<p>11. Login to publish.ovi.com, and hit <em>Create New Content</em>. Choose <em>Qt Based App</em>, answer a few legal questions, and hit <em>Continue</em>. Fill the form that follows, making use of the icon you created in step (6) and the screenshot you created in step (9). Hit <em>Create</em>.</p>
<p>12. Click on the <em>Content files</em> tab. Click the button next to <em>Qt file</em> and upload the &lt;yourapp&gt;_installer.sis file you created in step (10).</p>
<p>13. Enter the Nokia UID that you used in step (10).</p>
<p>14. Select <em>Requesting Nokia Signing</em> as the Symbian Signed Type. Hit <em>Upload &amp; Continue</em></p>
<p>15. For the platforms/devices that you identified in step (7), specify the amount of testing done. Leave the rest of the platforms as is. Click <em>Next</em></p>
<p>16. Select the countries to publish in, hit <em>Next</em>, select the languages that it works with, hit <em>Save</em>. Then click on the <em>Submit to QA</em> button under the <em>Distribution</em> tab. You might have to wait 6-8 working days for the QA to complete.</p>
<p>17. Be happy.</p>
<p><strong>References:</strong><br />
[1] <a href="http://wiki.forum.nokia.com/index.php/Guide_to_Publishing_Qt_Applications_to_the_Ovi_Store">Guide_to_Publishing_Qt_Applications_to_the_Ovi_Store</a><br />
[2] <a href="http://blogs.forum.nokia.com/blog/ovi-publisher-alert/2010/08/02/qt-content-qa">Qt content Q&amp;A</a><br />
[3] <a href="https://p.d.ovi.com/p/g/ovistore_static/docs/Publisher_Guide.pdf">Ovi Publisher Guide (pdf)</a><br />
[4] <a href="http://www.forum.nokia.com/Distribute/Packaging_and_signing.xhtml">Packaging and signing</a></p>
<p><small><br />
<strong>Update:</strong><br />
<em>11/May/2011:</em> Commands order changed in step 10 B (ii) &#8211; the .pkg files created by qmake shouldn&#8217;t get deleted.<br />
</small></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.forwardbias.in/2011/04/publishing-symbian-apps-to-ovi.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Business as usual</title>
		<link>http://blog.forwardbias.in/2011/02/business-as-usual.html</link>
		<comments>http://blog.forwardbias.in/2011/02/business-as-usual.html#comments</comments>
		<pubDate>Tue, 15 Feb 2011 07:03:44 +0000</pubDate>
		<dc:creator>girish</dc:creator>
				<category><![CDATA[KDE]]></category>
		<category><![CDATA[Qt]]></category>
		<category><![CDATA[girish]]></category>

		<guid isPermaLink="false">http://blog.forwardbias.in/?p=235</guid>
		<description><![CDATA[Disclaimer: I am an ex-troll and my company does a lot of Qt business with Nokia
I have been reading the largely negative comments in the blogs by Aron and Daniel about the future of Qt. Sigh, the anonymous internet has made it all too simple for people to post abusive comments and suggest conspiracy theories.
I [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Disclaimer</strong>: I am an ex-troll and my company does a lot of Qt business with Nokia</p>
<p>I have been reading the largely negative comments in the blogs by <a href="http://blog.qt.nokia.com/2011/02/14/update-on-qt/">Aron</a> and <a href="http://blog.qt.nokia.com/2011/02/12/nokia-new-strategic-direction-what-is-the-future-for-qt/">Daniel</a> about the future of Qt. Sigh, the anonymous internet has made it all too simple for people to post abusive comments and suggest conspiracy theories.</p>
<p>I empathize with the anger; my own business relies on the Qt ecosystem. However, this decision appears to be quite logical to me. On one hand, you have Symbian. Nobody in their right mind would want a Symbian future, let alone pitch it as the competitor for Android or iOS. If you think that line requires justification, you shouldn&#8217;t be reading this article, move along <img src='http://blog.forwardbias.in/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Second, MeeGo. I am going to speculate here since I have not seen the actual harmattan/MeeGo UI. So, let&#8217;s say we have <a href="http://www.engadget.com/2011/02/14/intel-shows-off-more-of-its-meego-tablet-ui-still-needs-lots-of/">something like the Intel MeeGo tablet</a> shown at MWC. Shocking, no? They are &#8220;working&#8221; on Copy&#038;Paste, zooming is slow, opening the app causes lots of flicker, the scrolling looks laggy and the presenter is defensive. Continuing my speculation, assuming Nokia&#8217;s UX is in a similar state, what would you as a CEO do? I mean, this is the state _today_, imagine 5 months back. I would just drop MeeGo and try shopping for the software elsewhere.</p>
<p>I believe that&#8217;s what has happened. Nokia had to make a tough call because MeeGo doesn&#8217;t appear to be shippable anytime soon. Some people are of the opinion that choosing an alternate OS is pointless because by the time one adapts to the new OS, one can clean up MeeGo. I think one reason here could be that Elop&#038;Co simply lost confidence in their developers after seeing the state of MeeGo. Another reason probably is that Maemo has always been a research project inside Nokia. MeeGo was announced exactly a year back at MWC 2010. I don&#8217;t think Nokia internally ever took it out of the &#8216;research project&#8217; mode. Yes, they had a little flirt with it trying to make it the main platform but they quickly seem to have discovered it&#8217;s not ready (Ballmer mentions that they started talks back in Nov 2010).</p>
<p>So, they now have to choose between Android and WP7. I simply don&#8217;t see how Nokia can compete with the existing vendors who have a big head start with Android phones. Back here in India, everybody and their great grandmother are _shipping_ Android phones. Motorola, LG, Samsung, HTC, Videocon (yes, that washing machine company), Dell, Sony, Acer, Micromax, Olive (yes, 10, that I know of!) are <a href="http://www.flipkart.com/search-mobile?query=android">already shipping</a> Android phones across all price ranges. With the upcoming cricket world cup and IPL, I expect lot more Android phones to be advertised. A Nokia android phone will be indistinguishable in this crowd. So, personally, I would go with WP7 too as there is some hope for differentiation. With WP7, Nokia can hopefully put pressure on MS (who wants this whole thing to succeed badly for their own future) to deliver on the software.</p>
<p>All this talk of conspiracy theories is quite baseless. Elop cannot make unilateral decisions, that&#8217;s not how companies work. He obviously requires the support of the <a href="http://www.nokia.com/about-nokia/corporate-governance/board-of-directors">directors</a>. If the share holders think this is a bad decision, they can fire the board of directors but I don&#8217;t see this happening. If my speculation about MeeGo&#8217;s current state is correct, all it takes is to show the share holders the current MeeGo prototype and that would be the end of discussion.</p>
<p>It&#8217;s also a good decision for Nokia for not considering Qt port on WP7. Heck, Qt/Symbian local compilation support on Linux/Mac isn&#8217;t there (for what 2 years?) with Nokia having complete control over all the software layers &#8211; the toolkit, IDE, OS. Qt on WP7 is a massive massive investment. It is probably a worthwhile undertaking that project after Nokia/WP7 is successful.</p>
<p>FWIW, we all have to be happy that Nokia has been open about this even before it has done anything about it. I, for one, totally appreciate their Openness. So, before you pour out your hate for Nokia, please remember that this is just business as usual. At the end of the day, they have to pay salaries. They have had to disappoint us developers for their own survival. If you are going to argue that MeeGo was truly groundbreaking and what not &#8211; please put your money on MeeGo, start your own company and ship MeeGo devices instead of pointing fingers at Nokia.</p>
<p>Where does this leave Qt? Qt has taken a bit big hit because of this decision. This decision means that Qt has suddenly become lot less relevant. I expect the MeeGo phone to be only as successful as the n900. I don&#8217;t expect MeeGo or Qt to die inside Nokia until WP7 phones are wildly popular. One single phone, that has been delayed over and over again and that has been sidelined into research does not give me a lot of confidence. Personally, I was hoping for this uber-awesome device for which I can build and _sell_ great applications.</p>
<p>My view is that Qt&#8217;s future lies outside Nokia. The Qt fanboy I am, I will do everything I can to keep Qt going. Qt has a very good future in the embedded space (settop boxes, IVI etc). Many companies I met at CES this year were committed to using Qt. For them to continue using Qt, the open governance model simply has to happen. Now. Qt has to be seen as a toolkit that has constant progress with an active community. Ports of Android, iOS can then become part of main stream. If this does not happen soon, future companies are just going to switch over to Android for their devices.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.forwardbias.in/2011/02/business-as-usual.html/feed</wfw:commentRss>
		<slash:comments>30</slash:comments>
		</item>
		<item>
		<title>qjsonparser: Parse and stringify JSON with Qt</title>
		<link>http://blog.forwardbias.in/2011/01/qjsonparser-parse-and-stringify-json-with-qt.html</link>
		<comments>http://blog.forwardbias.in/2011/01/qjsonparser-parse-and-stringify-json-with-qt.html#comments</comments>
		<pubDate>Fri, 21 Jan 2011 17:05:32 +0000</pubDate>
		<dc:creator>girish</dc:creator>
				<category><![CDATA[KDE]]></category>
		<category><![CDATA[Qt]]></category>
		<category><![CDATA[girish]]></category>

		<guid isPermaLink="false">http://blog.forwardbias.in/?p=229</guid>
		<description><![CDATA[To my knowledge, there are 3 Qt based JSON parsers out there &#8211; QJson, JsonQt and this. QJson uses bison for parsing and JsonQt is hand-written. I have used QJson before and it works perfectly fine. 
If you are like me, you will sense an opportunity here to write a qlalr based parser   [...]]]></description>
			<content:encoded><![CDATA[<p>To my knowledge, there are 3 Qt based JSON parsers out there &#8211; <a href="http://qjson.sourceforge.net/">QJson</a>, <a href="http://git.fredemmott.co.uk/?p=JsonQt;a=summary">JsonQt</a> and <a href="http://nilier.blogspot.com/2010/08/json-parser-class-for-qt.html">this</a>. QJson uses bison for parsing and JsonQt is hand-written. I have used QJson before and it works perfectly fine. </p>
<p>If you are like me, you will sense an opportunity here to write a <a href="http://qt.gitorious.org/qt/qt/blobs/00fa3f364fe9657317cb14191167aa9991c1758e/util/qlalr/doc/src/qlalr.qdoc">qlalr</a> based parser <img src='http://blog.forwardbias.in/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  So, here it is &#8211; <a href="http://git.forwardbias.in/?p=qjsonparser.git">qjsonparser</a>. The grammar is from <a href="http://www.ietf.org/rfc/rfc4627.txt">RFC4627</a>. It behaves very much like QJson &#8211; it returns a QVariant for the parsed JSON, uses QVariantMap for objects and QVariantList for arrays. Unlike the others, code is meant to be compiled in place (instead of a library). So, there&#8217;s just 3 files overall that you need to drop into your code (<a href="http://git.forwardbias.in/?p=qjsonparser.git;a=blob;f=README;h=450e97ee2d2decfabb35009c108466905e5491c2;hb=e148f792bd197a50867ed48a8da88b2eb6f407ed">README</a>).</p>
<p>If you haven&#8217;t used qlalr before:<br />
1. qlalr generates reentrant parsers out of the box. With flex/bison in C mode, one needs to do <a href="http://www.phpcompiler.org/articles/reentrantparser.html">all sorts of stuff</a> to create a reentrant parser. (QJson uses bison in c++ mode, so it&#8217;s reentrant)<br />
2. Complete control over shift/reduce. AFAIK, parsing incrementally using bison isn&#8217;t possible easily. With qlalr, you have to write the equivalent of yyparse() yourself and this gives a great deal of control over the shift/reduce steps.<br />
3. It&#8217;s completely undocumented. With bison, you don&#8217;t really need to understand how LALR parsers work. qlalr, on the other hand, will make you pull out your compiler book. Most of the yyparse() equivalent code that I mentioned can be copy/pasted. But if you are averse to copy/pasting seemingly obfuscated/random code, you absolutely have to understand how LALR parsers work before touching qlalr. Which is why you shouldn&#8217;t believe those posts which say that you will be at home with qlalr if you have used bison before. And oh, I don&#8217;t intend to spoil the fun of using it by documenting it <img src='http://blog.forwardbias.in/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .<br />
4. qlalr is used by QXmlStreamReader and the old QtScript code. I think it&#8217;s the best parser generator for Qt projects.</p>
<p>PS: Currently, I use a hand made lexer, but you can use <a href="http://qt.gitorious.org/qt/qt/blobs/f9c314aa306bfd4a237594775a8aeb14c858e66d/util/lexgen/README">lexgen</a> which is a Qt friendly scanner. I would have used it but it would add to the number of files. lexgen is used in the Qt&#8217;s CSS scanner. The CSS parser, however, is hand made since qlalr didn&#8217;t exist then.</p>
<p><strong>UPDATE</strong>: This project has moved to <a href="http://gitorious.org/qjsonparser/qjsonparser">http://gitorious.org/qjsonparser/qjsonparser</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.forwardbias.in/2011/01/qjsonparser-parse-and-stringify-json-with-qt.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>CES 2011</title>
		<link>http://blog.forwardbias.in/2010/12/ces-2011.html</link>
		<comments>http://blog.forwardbias.in/2010/12/ces-2011.html#comments</comments>
		<pubDate>Thu, 30 Dec 2010 06:36:14 +0000</pubDate>
		<dc:creator>girish</dc:creator>
				<category><![CDATA[Qt]]></category>
		<category><![CDATA[girish]]></category>

		<guid isPermaLink="false">http://blog.forwardbias.in/?p=227</guid>
		<description><![CDATA[I will be attending CES 2011 at Las Vegas. If you would like to meet up informally or to discuss about QML/Qt/WebKit consulting, please send me an mail.
]]></description>
			<content:encoded><![CDATA[<p>I will be attending CES 2011 at Las Vegas. If you would like to meet up informally or to discuss about QML/Qt/WebKit consulting, please send me an <a href="mailto:girish@forwardbias.in">mail</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.forwardbias.in/2010/12/ces-2011.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

