On 11/17/2010 03:59 PM, Junnonen Tomas (Nokia-MS/Helsinki) wrote:
> First try to use a simple direct property binding:
>
> main.qml:
> import Qt 4.7
>
> Rectangle {
> width: 200; height: 200
>
> Foo { bar: Text { text: "bar text" } }
> Foo { bar: Image { source: "bar-image.png" } }
> }
>
> Foo.qml:
> import Qt 4.7
>
> Rectangle {
> property Item bar
>
> children: bar
> }
>
> The parametrized bar item doesn't have to be a direct child of Foo
> either. Another way is to use the onBarChanged signal to Do What You
> Want(tm), for example if you need to anchor the item.
>
Thanks, that clarified things. How do I access bar's anchors within the
signal handler though? I tried various permutations but did not quite
figure it out yet.
Could you modify the example so that Foo has a single Text element
saying "This is bar", positioned just below whatever bar happens to be?
TIA
--
Pertti
_______________________________________________
Qt-qml mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-qml