Alan Alpert
Declarative UI
Posted by Alan Alpert
 in Declarative UI
 on Tuesday, July 28, 2009 @ 04:27

Here’s a video of a game we’ve written with Qt Declarative UI:

This completely functional implementation of Same Game is 334 LOC, 127 lines of QML and 207 lines of simple Javascript for handling the game logic. Considering that it includes animated movement and visual effects, that seems rather impressive. But LOC is not a very well defined metric - if you really want to see just how simple Qt Declarative UI makes things then checkout the source from the kinetic repository on gitorious (the kinetic-declarativeui branch) and look for yourself . Don’t worry, those 334 lines include some comments to help explain what’s going on. This demo does have a lot of stuff packed into those lines though, including dynamic object creation and great potential for custom themes.

So have a look at the Qt Declarative UI branch if you want to play with this powerful and emerging technology - or just with the games we’ve implemented with it.

14 Responses to “Qt Declarative UI SameGame”

» Posted by Patcito
 on Tuesday, July 28, 2009 @ 08:34

That’s cool. Will declarative ui be part of 4.6?

» Posted by pan2004
 on Tuesday, July 28, 2009 @ 09:42

Looks great :) When Qt4.6(supposed it has all the Kinetic stuff) will be released?

» Posted by nathan
 on Tuesday, July 28, 2009 @ 10:50

After following your git link and switching to kinetic-declarativeui, I hunted for a bit but couldn’t find the code. I checked demos, examples, src, and did a search, but didn’t come up with it. Is it called SameGaem? Can you just give a link directly to its folder?

» Posted by Simon Kern
 on Tuesday, July 28, 2009 @ 11:55
» Posted by ariya
 on Tuesday, July 28, 2009 @ 20:44

@nathan: Also, give yourself some time to learn ‘git grep’, it is a powerful tool and seriously will become your best friend :)

» Posted by Henrik Hartz
 on Wednesday, July 29, 2009 @ 03:09

@Patcito: Qt Declarative UI is a committed roadmap feature that we’re hacking away on as fast as our dexterous fingers are able to :) It’s a pretty complex project, and the best promise we can give you right now is that we are integrating features as they stabilize, focusing on low-level features first and foremost, and we’ll need to see where that takes us. Unfortunately we don’t comment on Qt release dates, but 4.6 will be out in the not too distant future.

» Posted by Gabriel Morrison
 on Thursday, July 30, 2009 @ 16:32

Hi, I want to checkout the kinetic-declarativeui branch from git, but I have no idea in how to do it. I already cloned the kinetic repo (using git clone git://gitorious.org/+qt-kinetic-developers/qt/kinetic.git), but now I don’t know how to get the kinetic-declarativeui branch. Is there a way to do that?
By the way, I’m really impressed with this project, Qt is just awesome! :D

Thanks.

» Posted by Vitaly
 on Saturday, August 01, 2009 @ 05:09
» Posted by Gabriel Morrison
 on Saturday, August 01, 2009 @ 06:09

Thanks, Vitaly. Now I have another problem: I can’t build it, because of some errors during configure. It seems there are missing headers on the include folder, and, in fact, in qt 4.5.2 tarball, the headers are organized in the include folder, but on my clone, the include folder doesn’t exist. Any clue about that?

» Posted by Nicolas
 on Saturday, August 01, 2009 @ 22:26

Javascript and declarative animation? How is the performance on ancient machines? Or more like… how is the performance compared to painfully writing the animation code by hand?

» Posted by Vitaly
 on Sunday, August 02, 2009 @ 08:16

@Gabriel Morrison
Do you have Perl installed?

» Posted by Gabriel Morrison
 on Sunday, August 02, 2009 @ 17:28

Thanks, Vitaly. Now everything is fine. :D

» Posted by dhess
 on Sunday, August 09, 2009 @ 17:18

This is all really exciting stuff. But the real question is, are we about to see a Qt Plugin released to compete with SilverLight, JavaFX, AJAX and Flash?

» Posted by Reed Hedges
 on Monday, August 10, 2009 @ 20:03

Are there any plans for using Qt Designer or a similar GUI tool to set up QML layouts visually? (At least the visual widget layout part.)



© 2008 Nokia Corporation and/or its subsidiaries. Nokia, Qt and their respective logos are trademarks of Nokia Corporation in Finland and/or other countries worldwide.
All other trademarks are property of their respective owners.