On Thu, Dec 1, 2011 at 5:21 PM, Koen Deforche <k...@emweb.be> wrote:

> QML (the language) doesn't allow C++ though?
> With only small syntactic changes QML could have been made to be confirming
> JavaScript.

See? I didn't understand what you meant :-)


> What you are referring to is Q_INVOCABLE and Q_PROPERTY ?

Sort of. There is also the linking with C++ and embedding QML files (qrc).


>> That being said, SMOKE, the bindings-generator Richard Dale and others
>> developed for Qt and KDE, already creates JavaScript bindings for Qt and
>> KDE, and they are faster than Nokia's.
>
> In my opinion, what I would like to have is something like this:
>
> load('wt.js');
>
> var w;
> var widget = new Wt.WContainerWidget({
>     width: '100px',
>     height: '200px',
>     children: [
>         w = new Wt.WText({
>             width: '100px',
>             height: '200px'
>         })
>     ]
> });
[...]
>
> This is perfectly fine JavaScript (with an appropriate wt.js stub file I can
> execute this with V8), but at the same time it is an almost declarative
> definition of a layout.

To me, that looks a lot more complex than QML. It is not really that
much more complex, but all those braces, brackets and parenthereses
make it look complex. That would scare the hell off of designers.

Designers? Yes, they are (or at least, were) one of the markets for Qt QUICK.

Qt QUICK is essentially WPF in Qt. Qt Creator even implements its own
Microsoft Expression Blend-like designer. WPF in turn is Microsoft's
version of Adobe Flash, a tool primarily targeted towards graphical
designers. IMHO that's why they all (Adobe, WPF, Qt) try to make it
look easy to develop with. I was at a Windows Phone 7.5 development
workshop a couple of months ago. Many in the audience were designers
and had developed with Qt QUICK. When they saw that pile of XAML...
they hated it.

QML on the other hand looks more like CSS. Very clean. That's my
opinion, of course, not an absolute truth :-)


> To be able to extend this with custom widgets and make available other
> properties and methods (ala Q_PROPERTY and Q_INVOCABLE) is of course a
> challenge to do without moc, but is an unrelated problem to the observation
> that QML is not proper JavaScript, but it could have been ?

I thought you wanted to have a
develop-with-JavaScript-(and-only-with-Javascript) version of Wt,
something like Sencha Touch, PhoneGap, etc and I was wondering how
would C++ code be combined with that.

After reading your answer, it's a bit more clear. I guess the .wtml
files would be also compiled as a resource and embedded in the
executable, right? How would C++ be called from JavaScript (and
viceversa)? Using JScript/JSignal or something special? What about the
V8 runtime? Would it become part of a future libwtdeclarative? (hint:
looks like a great topic for a FOSDEM talk ;-)

-- 
Pau Garcia i Quiles
http://www.elpauer.org
(Due to my workload, I may need 10 days to answer)

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to