Comments, Code and Qt. Some words about the wonderful world of software engineering

30Jul/1113

Why QNetworkAccessManager should not have the finished(QNetworkReply *) signal

Posted by kypeli

I was recently writing some network code in Qt using QNetworkAccessManager and again I did the mistake I've already done a few times. The reason for my mistake was that QNetworkAccessManager provides the finished(QNetworkReply *) signal.

There are essentially two ways to request some data from the net using QNetworkAccessManager. In the first approach you have the QNetworkAccessManager as an instance variable in your class and you connect the finished(QNetworkReply *) signal from the instance variable to your slot. This is a tempting solution as it provides a quick and easy solution to fetch some data from the net.

Technorati Tags: , , ,

5Jul/115

Sneak peek: Integrate your application with the Nokia N9 events view.

Posted by kypeli

I am working on a Qt C++ library that will integrate your application with the Nokia N9 MeeGo Harmattan event feed page. You can add and update items with your icon, text or even a list of images that will be shown on the event feed page. I still want to add some features and polish the code before publishing it, but the library will be open source.

So here's a video demonstrating what the library already can do. Stay tuned!

Update: The library has been published. More information here.

Technorati Tags: , , , , ,

3Jul/1115

Deploying Qt and Qt Quick applications on Windows

Posted by kypeli

I recently had to deploy a Qt Quick application on a Windows machine that did not have Qt installed explicitly on it. I think this is a pretty common use case that can cause quite some headache. You basically have two options if you want to deploy (or install) your Qt or Qt Quick based application to Windows. Either you can use the Windows Installer service directly or use some free or commercial utility to create a MSI based installer application that will deploy your application on Windows. Alternatively or at least as a first step you can package your application into a ZIP, or some other, package together with the necessary libraries that the application depends on. This is what I did and what I am going to explain here. When the package is extracted on the target machine, your Qt or Qt Quick application can be run from that directory just by launching the .exe file. Pretty neat.

Below I will explain some important points on how you want to create the package that you want to distribute your Qt application in. In my case I deployed a Qt Quick application that used Qt/3D and QtWebKit.

Technorati Tags: , , ,

26Jun/1114

What is the developer story for the Nokia N9?

Posted by kypeli

The MeeGo Harmattan powered Nokia N9 has now been out for a couple of days. Nokia's developer pages has a whole section dedicated to the Nokia N9 and we also have some great UX guidelines available. But as an app developer I am really just interested in writing my code and deploying it on to the device or the emulator. I already wrote earlier that the "official" developer story around Qt SDK 1.1.2 did not work for me and I am still wondering if this approach will work really well in Windows and OS X.

I have also read the blog post from Nokia Developer's Kate Alhola on how to develop Qt Component apps for MeeGo Harmattan in Ubuntu without Scratchbox. This lead me to conclude that Nokia now has at least three ways how developer can develop apps for the Nokia N9 and all of them have some issues.  All of these approaches are also described on pages that are hosted and maintained by Nokia which adds to the confusion.

Technorati Tags: , , , , ,

25Jun/1112

How to set up MeeGo Harmattan development environment in Linux

Posted by kypeli

Nokia N9 and MeeGo Harmattan are here. These are good times to be a Qt developer. And if you are like me, you downloaded the Qt SDK 1.1.2 from Nokia that contains the experimental Harmattan target for Qt Creator. However, not sure about you, but I never got the QEMU to work which I though would be a part of the Qt SDK 1.1.2. Whenever I launch a Qt application with the Harmattan as the selected target, I get an error saying that QEMU was not running, so I assume it's not included or Qt Creator cannot find it. Or then I just don't understand how to set it up in Qt Creator... There's even a page at developer.nokia.com that explains how to use and install the QEMU on a Linux Debian based machine, but the download link to QEMU is broken (25.6.2011). Also it seems that it's a bit open what the deal with QEMU on Windows or OS X based machine are... I haven't seen similar pages for downloading QEMU for other than Linux. So at this point I am not sure if and how the QEMU should work together with Qt Creator. I forgot about the QEMU option then.

Update: Ok, I got QEMU running in Linux. It seems there is one step missing in the default Qt SDK 1.1.2 installation. What you need to do is manually select "MeeGo 1.2 Harmattan API" as the Qt version to build with, even if you selected the Harmattan target (there is also a "Harmattan Platform API" Qt version available to use - not sure what that is...).

To use QEMU with Qt SDK 1.1.2, go to “Projects > Harmattan > Build > Edit build configuration” and click “Add”. Select “Using Qt Version MeeGo 1.2 Harmattan API (Qt SDK)”. This was in the comments of Qt Labs blog post - I hope Nokia can address this issue soon. I only tested this in Linux. But QEMU is SLOOOOOOW. If you are using Linux, I think you are better off sticking with Scratchbox.

Technorati Tags: , , , ,