[Interest] PropertyAction doesn't work with anchors

Dmitry Volosnykh dmitry.volosnykh at gmail.com
Wed Aug 5 09:52:15 CEST 2015


What if you specify a single property: "anchors" and set it to object
value: { "bottom": 100; "top": 100 }

PS. Just a suggestion. Have not done something similar by myself.

On Wed, Aug 5, 2015 at 2:33 AM, Ruslan Moukhlynin <ruslan at khvmntk.ru> wrote:

> Suppose we have following code:
>
> Rectangle {
>
>     id:  rect
>
>     width: 100
>
>     height: 100
>
>
>
>     MouseArea {
>
>         anchors.fill: parent
>
>         onClicked: {
>
>             rect.state = "state1"
>
>         }
>
>     }
>
>
>
>     states: [
>
>         State {
>
>             name: "state1"
>
>             AnchorChanges {
>
>                 target: rect
>
>                 anchors.bottom: parent.bottom
>
>                 anchors.top: undefined
>
>             }
>
>             PropertyChanges {
>
>                 target: rect
>
>                 color: "red"
>
>             }
>
>         }
>
>     ]
>
>     transitions: [
>
>         Transition {
>
>             SequentialAnimation {
>
>                 PropertyAction {
>
>                     target: rect
>
>                     properties: "anchors.bottom,anchors.top"
>
>                     value: "100"
>
>                 }
>
>                 PropertyAnimation {
>
>                     target: rect
>
>                     property: "color"
>
>                     duration: 1000
>
>                 }
>
>             }
>
>         }
>
>     ]
>
> }
>
>
> anchors should be changed immediately but that not happens. PropertyAction
> works fine with some another properties but not with anchors.
> --
> With best regards,
> Ruslan Moukhlynin
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150805/a5244fc2/attachment.html>


More information about the Interest mailing list