Mathias Hasselmann

QML Hype

So yesterday I've skipped the chance to watch some "exciting" QML demos in Helsinki. This was quite surprising to some of my KDE rooted team mates. They didn't understand how I could not show the slightest sign of excitement.

Well, but actually I wonder for months: What's actually the fancy and awesome, the brilliant new, the exciting part of QML? It doesn't seem to be rocket science. It's nothing new. Declarative UIs are done for ages. To name some very few implementations there are Windows and PM/Shell RC files, Glade, GtkBuilder. You want to mix declarations with managed code? XUL and XAML have visited that land. You want to use JavaScript for your UIs? Flash, XUL, Dynamic HTML and Web Widgets, GObject Introspection.

So what am I missing except that Qt finally catches up to its competition? It's a welcome addition, but why should I be overly excited and die of excitement?

Comments

MoRpHeUz commented on March 18, 2010 at 12:50 p.m.

Most of the options you mentioned are either non free software (even closed source) or are not canvas based (Glade for example).

It's just impossible to create a richUI application using Glade. The only opensource technology that is comparable with QML is Edje from the EFL toolkit.

Cheers,

Tomaz Canabrava commented on March 18, 2010 at 1:16 p.m.

Glade and GtkBuilder are really not what QML is, you may compare Glade, GtkBuilder with QtDesigner, wich is basically the same - and may I add, is older than GtkBuilder or glade - . but QML? come on ;)
you may still yeld that qt finally catches up to it's competition, but... using fallacies in the place of truth?

Murray Cumming commented on March 18, 2010 at 1:34 p.m.

Commenters, how about actually answering the question, maybe even in some detail?

Heinz commented on March 18, 2010 at 1:37 p.m.

It would be much better if it was called GML.

Johan Thelin commented on March 18, 2010 at 1:42 p.m.

Please don't die of excitement! :-)

The cool thing with QML is that you can give it to a "designer", no need for C++, etc. With the QtQuick Designer tool (a part of QtCreator 2.0) you can handle it all through a graphical designer.

All the components of QML (JavaScript, states and transitions, graphics effects, animation classes) are available in 4.6. What is exciting about QML is the packaging and ease of use.

etcetera, etcetera, etcetera

Tomaz Canabrava commented on March 18, 2010 at 1:42 p.m.

Yah.... with a G it will be more open and such. and everybody loves G, because, you know, it's more gnucious.

now, seriously, GtkBuilder and Glade, and the other opensources examples besides Edge ( and that include XUL ) are just an API for creating User Interfaces from XML - Descriptions. ( and in that sense, QtDesigner is the same ).

now, QML on the other hand is a complete different beast ( and not because the language that it uses ( something similar to json ) since it could have the same effect using XML ( but that's not sane for human - writting ) ),

for a quick understanding of QML,
http://labs.trolltech.com/blogs/2009/...

Tim commented on March 18, 2010 at 2:08 p.m.

It makes it possible (and easy!) to have shiny animated flash-like UIs. Animation is the key difference.

There really aren't any competitors in the GTK world, but I think you knew that and are just pretending that it's nothing new so that you can say GTK isn't missing it.

twilightomni commented on March 18, 2010 at 2:36 p.m.

Being able to declare animations and transition paths for your UI elements by describing their state across the transitions, rather than having to generate actual animation frames or rebuild the GUI on-the-fly in your code.

You "declare" your elements and the transitions they can perform, and Qt will automatically handle the animation.

Can GTK do this?

John Carr commented on March 18, 2010 at 2:49 p.m.

So, as far as I can tell.. Its ClutterScript. But with a Designer tool too?

lz83 commented on March 18, 2010 at 2:53 p.m.

It's JavaFX Script for Qt.

Johan Thelin commented on March 18, 2010 at 2:59 p.m.

I'm not sure what JavaFX' and ClutterScript's capabilities are, but to me, as a developer using Qt, QML appeals as it lets me separate UI from code even more.

My code no longer have to carry code for setting up and handling the bling (animations, etc). I can trigger events in "QML space" and have QML trigger stuff in "C++ space" in a simple way, and I can expose a standard QAbstractItemModel interface to "QML space" and it Just Works(TM).

As for the G being more free. I know that Heinz and Tomaz probably said it and blinked their eyes and smiled. But still. It is an old discussion. Qt is free software - licensed under GPL 3.0 and LGPL 2.1.

Emmanuele Bassi commented on March 18, 2010 at 3:03 p.m.

so, it's ClutterScript plus ClutterSmith? ;-)

http://git.clutter-project.org/cgit.c...

Tomaz Canabrava commented on March 18, 2010 at 3:17 p.m.

Yah, There's no more discussion about the freeness of Qt, it's as free as it can gets ( I develop with it, btw ;) ) , I was just quoting LinuxHater's blogpost.

"Remind yourself that OO in C is not so bad. assert(gtk_no_really_its_not_so_bad). Also, remind yourself that GTK+ is way better than Qt because it has no commercial company writing code for it. So, you know, it's more free, or something, and it's got a + in the name."

Johan Thelin commented on March 18, 2010 at 3:26 p.m.

@Tomaz: one has to love a + :-)

Bob commented on March 18, 2010 at 4:06 p.m.

The whole QT/KDE promo strategy is focused on exagerated hype about old or not-so-new stuffs, considering the amount of comments I daily find in blogs it seems they have more "community sellers" than developers...

Tomaz Canabrava commented on March 18, 2010 at 4:19 p.m.

@Bob and yet.. a week commit log from KDE is bigger than a month commit log from a lot of other projects... ( yah, I know, don't feed the trolls, but bléh. )

Damien Lespiau commented on March 18, 2010 at 4:25 p.m.

Mixing structure and code is an interesting design choice, it may be just me, but I really want structure, styling, and logic to be separated.

Now, Clutter, GObject introspection and Gjs or Seed and you have exactly that: JSON to describe the structure, ECMAScript to code the logic, and CSS for the styling (Mx/St inside gnome-shell).

Richard Dale commented on March 18, 2010 at 4:50 p.m.

@Damien: it should be possible combine 'Smoke libraries', the Qt/KDE equivalent of GObject Introspection, with 'JSmoke' a JavaScript binding like GJS or Seed, and QML to produce something similar. I'm looking forward to doing some experiments anyway to see if it makes sense.

I don't know about whether it is a good idea or not to separate the JSON/QML part from the CSS part though. I assume this is something the QML developers have thought about.

Rob commented on March 18, 2010 at 5:59 p.m.

Richard: it is entirely feasible to allow for inline css in json, just like in html. It just has not been implemented yet.

By inline css i mean an object property that takes a CSS string, rather than an embedded stylesheet. Something like this:
{
"style":"background: red; border: 1px solid black"
}

Henrik Hartz commented on March 19, 2010 at 1:57 a.m.

@mathias: have you tried it for an extended period of time? The nice thing about it IMO is the simplicity and elegance of writing UI's, and the speed of implementation and deployment. Literally, just copy the QML files to mass storage on the N900 and it flies, GL/ES accelerated.. I know that other technologies do the same, and you're right that on a feature level there's nothing fundamentally new here (except maybe property binding to JS expressions?) What's so cool is how easy it makes life for both devs and designers, allowing them to work better together.. Well, that's my objective perspective anyway - I totally respect that others have alternative tools and feel more comfortable using them ;)

Aurélien Gâteau commented on March 19, 2010 at 10:24 a.m.

(1) """So yesterday I've skipped the chance to watch some "exciting" QML demos in Helsinki."""

(2) """Well, but actually I wonder for months: What's actually the fancy and awesome, the brilliant new, the exciting part of QML?"""

Maybe if you haven't skipped (1) you would have been able to answer (2)?

Note that I am not saying QML is the best invention since sliced bread: I have not tested it yet. Still, attending a demonstration about a new technology is probably a better way to learn about it than asking for some random comments on your blog.

nuno commented on March 19, 2010 at 5:48 p.m.

To me the huge bonus of QML is that I can actually use it, note that I'm a designer that even as troubles with css, and cant touch real code like c++.

Even if the quality of my code is not great it allows me to pass a much better message to the coder implementing the software, he can see exactly as I want it to look like. Its a wonderful tool for prototyping designs for the mobile world.