Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. [SOLVED]Execute different Transitions for the same State

[SOLVED]Execute different Transitions for the same State

Scheduled Pinned Locked Moved QML and Qt Quick
animations
3 Posts 2 Posters 1.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ealioneE Offline
    ealioneE Offline
    ealione
    wrote on last edited by ealione
    #1

    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?

    1 Reply Last reply
    0
    • B Offline
      B Offline
      Buttink
      wrote on last edited by
      #2
       transitions: [
              Transition {
                  ParallelAnimation {
                      NumberAnimation { properties: "scale"; duration: 600; easing.type: Easing.OutElastic }
                      ColorAnimation { duration: 200; }
                  }
              }
          ]
      
      1 Reply Last reply
      0
      • ealioneE Offline
        ealioneE Offline
        ealione
        wrote on last edited by
        #3

        Hi Buttnik,

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

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved