[Development] Toolability of mixing QML and JS

Rutledge Shawn Shawn.Rutledge at digia.com
Wed Jun 26 14:17:58 CEST 2013


On 26 Jun 2013, at 1:35 PM, Bubke Marco wrote:

> I think we mix WYSIWYG and direct manipulating. WYSIWYG is not the problem, we can simply send the 
> expressions to the qml items. But direct manipulating is the other way around. It is from the graphics
> representation to the text representation. E.g.
> 
> You could write:
> 
> Item {
>  x: parent.leftPadding + 30
> }
> 
> to describe a box model(like in HTML). But if we want to edit it's not so easy anymore. We could find out that we want only change 30, but because we know only the x value, we have to find out what the value of parent.leftPadding is. This complicates the already complicate transformation code. What about if you change the parent and this new parent has no leftPadding property? There are so many undefined cases that supporting some will lead to a "unexpected" behaviour. So we don't change x in this case at all. You have to do it on thw text level. If you use expressions in properties you are not anymore in the declarative world so we don't support this case anymore.

But you have the AST right?  So why not modify that and then regenerate the code by pretty-printing the expression?




More information about the Development mailing list