Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] Why won't my animation loop? (using loops: Animation.Infinite)
Forum Update on Monday, May 27th 2025

[SOLVED] Why won't my animation loop? (using loops: Animation.Infinite)

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 663 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.
  • T Offline
    T Offline
    trusktr
    wrote on last edited by
    #1

    I have this animation:
    @
    property alias angle: cloudRotation.angle; // assume this works.

        PropertyAnimation {
            id: cloudRotationAnimation;
            running: false;
            target: clouds;
            property: "angle";
            easing.type: Easing.Linear;
            to: 360;
            duration: 5000;
            loops: Animation.Infinite;
        }
    
        Component.onCompleted: {
            cloudRotationAnimation.start();
        }
    

    @
    The animation starts, but it doesn't repeat. Why not?

    1 Reply Last reply
    0
    • T Offline
      T Offline
      trusktr
      wrote on last edited by
      #2

      Doh. I fixed it. I had to add the "from:" property to the animation so it resets the angle back to the original value of 0 instead of animating from 360 to 360 on the second loop and onward:
      @
      property alias angle: cloudRotation.angle;
      PropertyAnimation {
      id: cloudRotationAnimation;
      running: false;
      target: clouds;
      property: "angle";
      easing.type: Easing.Linear
      from: 0; // <-- HERE
      to: 359;
      duration: 500000;
      loops: Animation.Infinite;
      }
      Component.onCompleted: {
      cloudRotationAnimation.start();
      }
      @

      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