Tuesday, December 29, 2009

QML Hello World (or calculate world)

Some thoughts about QML

QML reminds me a lot of Adobe Flex on Flash - my personal favourite tool for creating anything. Only difference is that QML is more suited for application development, as it allows full access to all system components - and is easily extensible with pretty much any normal qt components.

Read more on the snapshot:
and from Kenneths excellent blog on the subject:

Anyway, intro aside, I have also started doing a bit of coding now on QML and I really love it. It has nice separation of the declarative part (QML) and the logic part (either qt components or javascript). You can easily embed javascript to the qml code, but the clever guys at qt labs have made sure that you can only have tiny snipplets there. A welcome separation.

What has also been fun is that I have done ALL the coding on the pygtkeditor, so no coding on the mac, and all the coding on n900. Well, I did work on some button gfx a bit on mac, but that's it. Painting is not coding ;)

Anyway, take a look at the result of less than 400 lines of code. And the code is clean, sweet and easy to extend. Check out those transitions! They are 10 lines of code for the advanced, and about the same to get the fancy glow effect done to the buttons.

What I am really eagerly waiting for is a chance to see a proper flash-like editor for qml.


  1. Fun, Fun! I totally agree that the QML looks and feels pretty fun stuff. Will be good addition to the official Qt when ever that happens.

  2. that looks really good. I just started playing with python and QT. Now I'll need to read about QML :D

  3. I agree that QML is totally awesome! I also tried it once and in couple of hours (and ~80 lines of QML code, IIRC) I was able to implement a simple RSS feed reader. Your calculator looks much nicer and more polished though.

  4. Would you mind putting the code for the calculator demo online? It would be interesting to see.

  5. Any chance you can show us your "code"? :)

  6. Code is now available in commented form in http://wiki.maemo.org/QML-EnhancedCalcExample