[SOLVED]Execute different Transitions for the same State



  • I have a button with some text. Everytime I click at that button I have its scale animated for a duration of X seconds

     states: [
            State {
            name: "pressed"; when: mouseArea.pressed
            PropertyChanges { target: canvas; scale: 1.2; text: "Hold"; currentValue: 0 }
            PropertyChanges { target: buttontext; scale: 2.2; color:
                    Qt.darker(canvas.primaryColor, 1.25) }
            }
        ]
    
     transitions: [
            Transition {
                NumberAnimation { properties: "scale"; duration: 600; easing.type: Easing.OutElastic }
            }
        ]
    

    But I also want to change the colour of the text, this time with a smaller duration of Y.

    How can this be done?



  •  transitions: [
            Transition {
                ParallelAnimation {
                    NumberAnimation { properties: "scale"; duration: 600; easing.type: Easing.OutElastic }
                    ColorAnimation { duration: 200; }
                }
            }
        ]
    


  • Hi Buttnik,

    Thanks for the help, it does exactly what I was looking for.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.