Ugly bug in bindings
Anton Kreuzkamp
akreuzkamp at web.de
Tue Mar 3 08:37:16 UTC 2015
uh, nice one.
The problem was, that the binding was overwritten with a constant value. But
bindings are always evaluated last. Thus the binding won.
Fixed by properly removing the binding, when being overwritten.
Please test again with your code.
Cheers, Anton
On Monday 02 March 2015 21:51:25 you wrote:
> Dear Anton!
>
> Please look at following example:
>
> ----------------------------------------------- main.qml
> import QtQuick 1.1
>
> Rectangle {
> anchors.fill: parent
> color: "green"
>
> Subitem {
> id: qSome
> coords: [5,2,3]
> }
> }
>
> ----------------------------------------------- Subitem.qml
> Item {
> id: origin
> property var coords: parent.coords
> // maybe parent will have coords property?
> // if not, we consider that implementor of Subitem object will specify
> coords directly
> // see above, we set coords property to [5,2,3]
>
> property var positions: make()
>
> function make() {
> console.log("called make, coords=",origin.coords );
> return origin.coords;
> }
>
> }
> -----------------------------------------------
>
> The result of that code should be seen in console.
> We see:
>
> called make, coords= undefined
>
> But the correct result should be:
>
> called make, coords= [5,2,3]
>
> Maybe, I misunderstand something?
>
> Best Regards,
> Pavel Vasev
--
Gruß auch an die NSA.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 230 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/qmlweb/attachments/20150303/79b9f158/attachment.sig>
More information about the QmlWeb
mailing list