[Development] Toolability of mixing QML and JS

Thomas Hartmann Thomas.Hartmann at digia.com
Wed Jun 26 15:20:26 CEST 2013


> So such a simple expression is already JS not QML, and therefore it's opaque to you?  But I would think there should be a nested AST of a different kind then, or at least you could get the other AST by sending that expression to the JS parser.  (Now that we own it, instead of the V8 black box)

This is exactly what we do. We do evaluate the expression if we have a 
complete enough context. But what do you do if an expression contains 
several literals or if we cannot build the inverse function?

There is no way we can allow editing of expressions by drag and drop in 
a predictable way. This is why we just lock the property and mark it as 
having an expression. You can still edit the expression as a string, but 
not in the form editor.

Just think about something like this:

width: Math.max(Math.min(recentProjects.contentHeight + 120,
recentProjects.height), sessions.height)

And this is a real life example.

In practice bindings like this are not that often and people who use 
them can write the expression as code/string. You still get WYSIWYG so I 
do not think there is a problem.

Kind Regards,
Thomas Hartmann

More information about the Development mailing list