Qt Declarative UI SameGame

Published Tuesday July 28th, 2009
14 Comments on Qt Declarative UI SameGame
Posted in Qt Quick

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.

Do you like this? Share it
Share on LinkedInGoogle+Share on FacebookTweet about this on Twitter

Posted in Qt Quick


Patcito says:

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

pan2004 says:

Looks great ๐Ÿ™‚ When Qt4.6(supposed it has all the Kinetic stuff) will be released?

nathan says:

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?

ariya says:

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

Henrik Hartz says:

@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.

Gabriel Morrison says:

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! ๐Ÿ˜€


Gabriel Morrison says:

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?

Nicolas says:

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?

Vitaly says:

@Gabriel Morrison
Do you have Perl installed?

Gabriel Morrison says:

Thanks, Vitaly. Now everything is fine. ๐Ÿ˜€

dhess says:

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?

Reed Hedges says:

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.)

Commenting closed.

Get started today with Qt Download now