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. sequential animation on property change

sequential animation on property change

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 2 Posters 271 Views 1 Watching
  • 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.
  • R Offline
    R Offline
    RobM
    wrote on last edited by
    #1

    I am attempting to run a Sequential Animation whenever the optionsListEnabled property changes:

    property int maxHeight: 100
    property bool optionsListEnabled: modelData.enabled
    
    onOptionsListEnabledChanged: heightChange.start()
    SequentialAnimation
    {
      id: heightChange
    
        NumberAnimation
        {
            from: statusIconButton.implicitHeight
            to: statusIconButton.maxHeight
            easing.type: Easing.OutExpo
            duration: 300
        }
    
        NumberAnimation
        {
    	from: statusIconButton.maxHeight
    	to: statusIconButton.implicitHeight
    	easing.type: Easing.OutBounce
    	duration: 300
        }
    }
    

    however, I can't figure out how to make statusIconButton.impliciteHeight be the target. In other words I am trying to toggle the implicitHeight of the button to change whenever the property changes. I tried this:

    SequentialAnimation on implicitHeight
    

    but that causes it to change both when the property changes, and on startup of the application when implicitHeight is being set which is not what I am looking for. Any suggestions?

    1 Reply Last reply
    0
    • GrecKoG Offline
      GrecKoG Offline
      GrecKo
      Qt Champions 2018
      wrote on last edited by
      #2

      Add

      target: yourItem
      property: "implicitHeight"
      

      in your NumberAnimations.

      Note that instead of

      onOptionsListEnabledChanged: heightChange.start()
      SequentialAnimation {
          id: heightChange
          //...
      }
      

      You can do

      Behavior on optionsListEnabled {
          SequentialAnimation {
              //...
          }
      }
      
      1 Reply Last reply
      2

      • Login

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