On Thu, 10 May 2012 19:06:39 ext Canol Gokel wrote:
> Hello,
> 
> I know when we do something like this in QML:
> 
>     myStringProperty: aStringProperty
> 
> myStringProperty is dynamically evaluated whenever aStringProperty changes.
> 
> Question 1: If we write the assignment inside JavaScript like this:
> 
>     onSomethingHappened: myStringProperty = aStringProperty
> 
> would myStringProperty again change whenever aStringProperty changes later
> in runtime? Or is it just one-time assignment this time?

This is a one-time assignment. Qt5 adds API to allow you to specify bindings 
instead (using a new function, so a = b is still just a one time assignment).

> Question 2: If we use an element instead of a basic type like this:
> 
> 
>     myCoordinateProperty: aCoordinateReading
> 
> 
> would myCoordinateProperty.latitude change whenever
> aCoordinateReading.latitude changes?

Yes, because myCoordinateProperty is a reference to the same object instance 
as aCoordinateReading.

> Question 3: Do I make the distinction right between basic types and
> elements? For example; double, string etc. are "basic types" and
> Coordinate, Page, Rectangle etc. are "elements"?

Yes. This is explained somewhere in the documentation, but I forget where.

-- 
Alan Alpert
Senior Engineer
Nokia, Qt Development Frameworks
_______________________________________________
Qt-qml mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt-qml

Reply via email to