I thought, that it could be a good idea to write a short post how to port an existing Qt4 QML application to Qt5. At first, if you are not familiar how Qt will change for the next version, you should read this doc: The Road to Qt 5. The one of the biggest changes is happening under to hood of QML / QtDeclarative module. As Lars Knoll, wrote in the document, there is a new scene graph, which will replace the old QGraphicsView/QPainter based implementation. So basically what this means is that the gap between QML and HW gets smaller. In other words, in Qt5 you will get a kick ass performance for your QML applications plus extra features like shaders. Yes, you can also use shaders in your QML code!
I just wanted to tell to the world that next Monday I’ll be heading to the Qt Developer Days in Munich. Last year it was awesome event and I hope it reaches to the same level this year. I’m also very interested in to see d-pointer’s two applications QuickFlickr and Podcatcher in a Qt demo pavilion hosted by Nokia. There is also an embassy area for Qt Ambassadors, so I’ll be hanging around there to meet other Ambassadors.
It was February 2010 when I started my experimental project how to use QML and C++ together in a same application. At that time, there wasn’t too much information and examples how you should integrate e.g. C++ backend to QML UI. Remember that Qt Quick was released about 6 months after I started my project so it was lacking quite a lot documentation back then. The QML API was constantly changing too, not any big changes, but still enough to cause me headache.
My original idea was that it would be nice to make a client application for Flickr. In the first phase, I started to look for Qt based Flickr API and I found a simple Flickr API called QtFlickr. In the next phase, I wrote a simple wrapper on top of QtFlickr, which was exposed to QML side. The first UIs were quite rough and basically I was only trying to show what ever content from Flickr. Here’s an old video of the one of the first UIs of the QuickFlickr.
I have rewritten QuickFlickr UI many times during this journey. Mostly because, I found that it was so easy to prototype and try different things with QML. I think, when I ran the first versions of QuickFlickr on N900 and N8, I started to realize how I would like the UI to look and act like. QuickFlickr has been unofficially released (for testing) couple of times and I’ve got really valuable feedback from many users.
Btw, one interesting fact is that there are over 600 authenticated QuickFlickr Symbian^3 and Maemo5 users even though it hasn’t been officially released to any of those devices yet.
It’s been a while since I did any experiments with Qt. I decided to take a look at Qt5 and QML. The first thing was to fetch the source code and figure out how it can be built. I was really surprised that in the end I didn’t encounter any problems while building it.
Building Qt5
It took only few steps to build Qt5 on Mac.
git clone git://gitorious.org/qt/qt5.git qt5
cd qt5
./init-repository
qtrepotools/bin/qt5_tool -c -p -b
You can check out qtrepotools -h to choose what ever options you want.
Playing with QML
After building, you find all the stuff from qt5/qtbase directory. There is a bin directory where all the required binaries are. If you want to test how new QML with really fast scene graph works, you can try to run demos using qmlsene binary. Here’s a video where I run four different particle demos on not-so-new 13″ MacBook Pro without any big problems.
This blog post was short this time. If you are interested in what happens in the Qt development, the Qt5 is really worth to check. Naturally there are also other things happening in the background like modularization in addition to QML development. Personally, I think the best way to follow Qt development is to read Qt Labs Blog. But in the end I can’t say anything else that good work Trolls. Can’t wait that they will get Qt5 released in 2012.
I had a little break of developing Qt stuff, but after receiving N950 from Nokia, I decided to continue with QuickFlickr development. The original target HW for QuickFlickr has always been Nokia’s next “linux phone”. Even though, Nokia kindly gave me two Symbian devices, I never got so excited to do development on Symbian platform/devices.
I also feel responsible for continue my Qt Ambassador project (I need to update the project page. It’s so out-of-date) too, so here I am now, with a one preview video where QuickFlickr runs quite smoothly on N950. Let’s watch it first:)
The video above is quite heavily edited because the lack of my video shooting skills. With editing I mean that I did stupid things while shooting the video so I cut few clips away.
I'm getting a feeling that I need to throw up soon. No booze involved this time… Should I be worry? Damn, I don't want to have a stomach flu 5 days ago