On Fri, Apr 25, 2014 at 10:21:04AM +0800, Sze Howe Koh wrote: > On 24 April 2014 00:35, André Pönitz <apoen...@t-online.de> wrote: > > On Wed, Apr 23, 2014 at 10:50:23PM +0800, Sze Howe Koh wrote: > >> QML is a declarative language > > > > Are you considering sequences of JavaScript statements, especially control > > flow statements, as "declarative"? > > > > Andre' > > Of course not. :-)
Right. With the obvious consequence for .qml files containing such. Within a .qml file, JavaScript is in no way an "optional extension" of some "declarative QML language". QML and JavaScript are _inseparably_ tied together in the QML/JS hybrid contents of a .qml file. A quick grep in qtdeclarative/examples/quick/demos e.g. finds the pattern 'if (' in 30 out of 88 .qml files. All nine examples are affected. And that's not "just an accident", as "pure declarative QML" features like ScriptAction, or on{Triggered,Clicked,Loaded,...} handlers _require_ immediate use of JavaScript. > I was highlighting the fact that their declarative > structures make QML or HTML+CSS good for describing a GUI's looks. > This is in contrast to imperative languages like C++ or JavaScript or > PHP -- I don't want to use any of these to describe a GUI's looks. Not wanting to "use imperative languages like [...] JavaScript [...] to describe a GUI's look" is fine with me, but how on earth is that an argument _in favour_ of .qml? You could have made the point "declarative structures are good for GUI description" for Qt Widget's .ui files, after all, .ui files contents pretty much _is_ declaring layout nesting and property values. Trying to make that point for "parts of the contents of at .qml file" (and even admitting that it doesn't hold for "the other parts") is misleading at best. > (Alternatively, one could argue that QML is a hybrid > declarative-imperative language). Alternatively, one could argue that QML is a not-well-defined, non-standard languange largely incompatible with established tools and workflows, with developers not agreeing on fundamental aspects of its nature, costs and benefits... But, hey, which fool would raise such a claim ;-} To get back on the constructive trail: The meaning of "QML" keeps oscillating between "QML is whatever can be written in a .qml file" and "QML is only the declarative outer layer of a .qml file". Terminology should be clear, and uniformly applied to all audiences (users, marketing, developers) So "someone" should sit down and come up with a single "official" definition of the basics: What is QML, how does it relate to JS, what's the relation to .qml files. http://qt-project.org/doc/qt-5/qmlapplications.html does not suffice. The use of the term "QML" there and on the directly linked pages match mainly the "QML is whatever can be written in a .qml file" concept ("develop your own applications using QML and Qt C++") but sometimes mentions JavaScript seperately ("integrate QML code with JavaScript and C++."). Andre' _______________________________________________ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development