Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

[solved] Strange behaviour when animating opacity

$
0
0
The following code to animate opacity works:     id: root;     opacity: 1.0;     states:     [         State         {             name: "disappeared";             when: root.isDisappearing         }     ]     transitions:     [         Transition         {             from: "*"; to: "disappeared";             NumberAnimation             {                 target: root;                 properties: "opacity";                 from: 1.0; to: 0.0;                 duration: 700;                 easing.type: Easing.Linear;             }         }     ] The following code to animate a colour works, too:     id: root;     states:     [         State         {             name: "disappeared";             when: root.isDisappearing             changes:             [                 PropertyChanges { target: msgText; color: "#00000000"; }             ]         }     ]     transitions:     [         Transition         {             from: "*"; to: "disappeared";             ColorAnimation { duration: 700; easing.type: Easing.Linear; }         }     ] However, the following code to animate opacity doesn’t work, the result would directly jump to fully transparent:     id: root;     opacity: 1.0;     states:     [         State         {             name: "disappeared";             when: root.isDisappearing             changes:             [                 PropertyChanges { target: root; opacity: 0.0; }             ]         }     ]     transitions:     [         Transition         {             from: "*"; to: "disappeared";             NumberAnimation { duration: 700; easing.type: Easing.Linear; }         }     ] Why is this so? Feels like a bug to me…

Viewing all articles
Browse latest Browse all 4972

Trending Articles