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. Is it possible to change the animation duration after the animation starts?
Forum Updated to NodeBB v4.3 + New Features

Is it possible to change the animation duration after the animation starts?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 223 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.
  • Q Offline
    Q Offline
    QTLeearn
    wrote on last edited by
    #1

    Hi, I am using PathAnimation like the following:

                PathAnimation
                {
                    id: pathAnimation
                    target: parent
                    duration: 1000
                    running: true
                    path: pathId                   
                }
    

    After the animation starts, halfway during the animation, is it possible to change the duration? Thank you in advance

    MarkkyboyM 1 Reply Last reply
    0
    • Q QTLeearn

      Hi, I am using PathAnimation like the following:

                  PathAnimation
                  {
                      id: pathAnimation
                      target: parent
                      duration: 1000
                      running: true
                      path: pathId                   
                  }
      

      After the animation starts, halfway during the animation, is it possible to change the duration? Thank you in advance

      MarkkyboyM Offline
      MarkkyboyM Offline
      Markkyboy
      wrote on last edited by
      #2

      @QTLeearn -there may be plenty of ways to do this, I would start with trying Timer;

      
          PathAnimation {
              id: pathAnimation
              target: null // changed to 'null' so I can run the code
              duration: 5000
              running: true
              path: null // changed to 'null' so I can run the code
          }
          // for notifying initial duration rate
          Timer {
              interval: 500
              running: true
              repeat: false
              onTriggered: {
                  console.log("duration is 5 seconds")
              }
          }
          // for notifying changed duration rate
          Timer {
              interval: 2500
              running: true
              repeat: true
              onTriggered: {
                  pathAnimation.duration = 2500
                  console.log("duration is now 2.5 seconds")
              }
          }
      }
      
      

      Don't just sit there standing around, pick up a shovel and sweep up!

      I live by the sea, not in it.

      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