[Development] Toolability of mixing QML and JS

Joerg Bornemann joerg.bornemann at digia.com
Wed Jun 26 14:03:53 CEST 2013

On 26/06/2013 13:35, Bubke Marco wrote:

> 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.

You have the value of x and you know that 30 is a number literal.
You could "assume" that + is the addition operation, because 30 is a 
number and x is of type int.

Then the value of parent.leftPadding is (x - 30).
No need to actually evaluate it.

I don't see a general solution for things like this though. Handling 
those cases would be a huge bouquet of special cases.



Joerg Bornemann
Digia, Qt

More information about the Development mailing list