
First look: Qt 5 makes JavaScript a first-class citizen for app development - evo_9
http://arstechnica.com/business/news/2012/04/an-in-depth-look-at-qt-5-making-javascript-a-first-class-citizen-for-native-cross-platform-developme.ars
======
jlarocco
I've used Qt for a few years, and I feel like the move away from C++ is a
mistake. I don't see the advantage of QML over HTML and Javascript.

~~~
sho_hn
I wouldn't really call this a "move away from C++", necessarily. In practice,
you end up writing your backend in C++ and your frontend in QML; the backend
proffers data models the QML then pours into a user interface.

As for the advantages of QML over HTML and JavaScript - well, a sane layout
model for one, proper support for modules/packages, ...

~~~
hartror
Exactly.

I have been writing a QML application the past couple of months. I have
written a lot of real time C++ then tied it together with QML. It has given me
a flexibility in how the components interact, being able to change
functionality with little effort has allowed me to have low turn around when
the design has evolved.

The application is such (embedded hardware with video playing) that not many
solutions have both the agility and performance that QML offers me.

Gee sounds almost like marketing copy, but it is true!

~~~
jlarocco
Could the same thing be done using plain HTML inside a QWebView?

Honestly, I should probably look into it a little more before asking questions
like these, but so far I've just got the impression it's not worth the time...

~~~
daliusd
No, the same thing can't be done using plain HTML (+ Javascript and CSS). You
can get result that visually and functionally looks the same but it will be
very hard to get desired result (it is not worth the time), e.g. have you ever
tried to get window height in HTML and do something with that? Actually I
would love if I could use QML instead of HTML in browser in some cases. HTML
and QML has quite different purpose: HTML is for documents that can be styled
using CSS, while QML is for UI. Web apps could benefit from QML a lot if we
could use it in browser. However I guess there is no interest for that most
probably, because with FireFox you can write web apps using XUL for at least 6
years already (if not more) - the only problem is that apps will not be cross-
browser.

------
danmaz74
Cross-platform mobile development isn't still mature enough, and for Nokia it
would be a winning move to create a great tool that allowed developers to
easily create apps for iOS, Android, and then whatever OS will run on Nokia
phones.

~~~
sho_hn
Over at KDE, we're hosting the development of an Android port of Qt, dubbed
Necessitas. There's also a port to iOS underway elsewhere.

------
damian2000
Did anyone notice the similarity to the announcement made with Windows 8 i.e.
JS becoming a 'first class citizen' when developing apps ...
[http://www.readwriteweb.com/hack/2011/09/build-2011-html5-js...](http://www.readwriteweb.com/hack/2011/09/build-2011-html5-js-
first-clas.php)

seems like MS and Nokia are both trying to attract JS developers.

------
mdaniel
I hope they will at least look at XUL to try and understand what is good and
what is suboptimal in that space.

This sounds like a great thing (less C++ means wider availability of potential
developers), but I will be really sad for my industry if QML ends up running
into the same landmines that XUL has already uncovered.

------
dbbolton
Didn't GTK3 kind of already do that?

~~~
sho_hn
Not that I know of. Gnome Shell makes heavy use of JavaScript, but in a way
unrelated to GTK+ itself. JavaScript bindings are of course also nothing new
in the Qt world; KDE has had KJSEmbed for many years to write KDE/Qt apps in
JavaScript, and Qt itself offers QtScript to generate ECMAScript bindings to
Qt APIs for years as well.

Qt 5 goes quite bit beyond simply allowing you to access traditional C++-style
APIs from JavaScript, however, it essentially implements an all-new UI toolkit
based around a declarative language dubbed QML that is actually JavaScript and
lets you jot down UIs and their behaviors in a sort of JSON-plus-logic
fashion.

------
sateesh
Any thoughts on how this development would affect PyQt which provides Python
bindings to Qt ?

------
elliotlai
a good call

