[Qt-qml] Anchors and states
Colin Kern
colin.kern at gmail.com
Thu Dec 2 04:01:22 CET 2010
On Wed, Dec 1, 2010 at 5:16 AM, <ext-ivailo.iliev at nokia.com> wrote:
> Hi,
>
> I'm not sure if there is similar topic about this issue - so if yes please
> just if forward me to there and accept my excuses. thanks
>
> I'm trying to create very simple example with states and anchors. In general
> what I want to do is click a button and "glue" a rectangle to the top-right,
> then click another button and stuck it to the bottom-left. But it seems that
> anchors.(bottom|left|right|top) stay remembered after the state is changed
> to the other one. I tried to some-how zero the
> andhors.(bottom|left|right|top), but it did not work with null, null, 0, ""
> and other stuff I've tried.
>
> [code removed]
>
> So please if someone know how I can de-tack from anchors or some-how ignore
> already anchored attribute please help. If it's not possible it would be
> also good to know.
>
> Thanks,
> Ivo
>
As was suggested, the best way is to use AnchorChanges. For future
reference, though, the binding to remove an anchor is the keyword
'undefined'. It probably would work with PropertyChanges using that.
Colin
More information about the Qt-qml
mailing list