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!
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.
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 like to distribute my QML application so that everything comes with a single binary executable. In practice this means that I have defined that all my QML files are compiled into binary using Qt’s resource compiler. Resource system in Qt is quite nice, but there is annoying bug in Qt creator. Sometimes it doesn’t recompile resources even though I have modified a QML file. This means that you need to select “Clean” and “Build” from Qt creator in order to get modifications compiled. This takes time.
Some time ago, I figured out a workaround for this. You can add a custom build step to your Qt Creator’s project. This build step modifies e.g. an image that is included the project and then resources are recompiled. Here’s a screenshot how you can do it.
Custom build step to make rcc run every time you compile.
I added the custom build step to the first (touch quickflickr.png) and when my project is being compiled it notices that some of the resources have changed and it runs resource compiler too. This is far from an elegant solution, but at least it works for me and I don’t need to run “Clean & Build” which takes for ever. At least, it feels so after you have recompiled your project for the 10th time.
UPDATE: I thought, that there would have been a bug about this but couldn’t find a onet from Qt’s issue tracker so I created a new one: QTCREATORBUG-5743.
I hope this trick will help some one else too. Thanks for reading my blog and thanks for Bale to encourage me to write this “tip of the day” post. Cheers!
This is yet another blog post about the announcement of Nokia and Microsoft. I felt, I want to share my thoughts about it, but first let’s put here a nice picture which tells more than 1000 words.
The future of Nokia? Microkia?
Mr Elop’s Memo
Before the official announcement of Nokia and Microsoft collaboration, someone leaked Mr. Elop’s memo and it gained pretty much publicity. When I read the memo, I was surprised, how much I shared the same opinions with Mr. Elop. I’ve seen how things work internally in Nokia and I truly believe that it’s time for doing some serious reorganizations inside Nokia. Actually it should have been happened years ago.
But I can’t emphasize too much that I disagree with Mr. Elop how things ended up. Actually I’m not sure who gets most out of this deal, because Nokia stock value dropped pretty much after the announcement.
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