[Interest] Strange behavior when binding through property aliases in QtQuick2

Preet prismatic.project at gmail.com
Fri Jul 12 22:59:33 CEST 2013


Hi

I'm running into some behaviour with nested property aliases in QtQuick2
that I'm having trouble understanding.

I have a nested item in a component defined in a separate file (ie
"CustomItem.qml": Item { Row { Nested { etc... } } }) and I want to access
certain properties from the outside. So I use aliases to bring out whatever
properties I care about out to the 'surface'. One of these is a color
property.

Assigning a value or binding a property through the alias seems to work
except the following specific case fails:
* The initial state of the nested property is bound to a property
* The alias is indirect and refers to the Item, not Item.property
* I try to bind the nested property to another property

Changing any of the above seems to make the alias work as expected (ie,
having the initial state of the nested property be an assigned value rather
than a property binding, or using a direct alias).

Is this expected behavior?

I put together a minimal demo here. QSIcon is the nested item whose
properties I'm trying to get access to.
http://pastebin.com/raw.php?i=gkbb0DZc


Preet
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130712/71c438a5/attachment.html>


More information about the Interest mailing list