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. Why the type NumberAnimation on x don't work when i change it?
Forum Updated to NodeBB v4.3 + New Features

Why the type NumberAnimation on x don't work when i change it?

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 1 Posters 585 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.
  • stackprogramerS Offline
    stackprogramerS Offline
    stackprogramer
    wrote on last edited by
    #1

    hi,Why the type NumberAnimation on x don't work when i change it
    from :0 ;to:100; change to from:0;to:(menuspiral.width)/3;(menuspiral is Id window and so menuspiral.width is width of screen. )
    for more inforamtion this source work and my image horizontally from 0 to 100 was moving..

     Image {
             source: "Image-Core-Render/SVG-Fruit2th/Fruit2-7.svg"
    
             y: (menuspiral.height)/2
              width: 100; height: 100
    
              NumberAnimation on x {
                  duration:2000
                  loops: Animation.Infinite
                  running:true
                  from: 0; to:100
              }
              MouseArea { id: myMouse }
          }
    

    but for this source it doesn't move and doesn't has any animation,
    it is fiixed!

     Image {
             source: "Image-Core-Render/SVG-Fruit2th/Fruit2-7.svg"
    
             y: (menuspiral.height)/2
              width: 100; height: 100
    
              NumberAnimation on x {
                  duration:2000
                  loops: Animation.Infinite
                  running:true
                  from: 0; to:(menuspiral.width)/3
              }
              MouseArea { id: myMouse }
          }
    

    how can i solve my problem,thanks for reply.

    1 Reply Last reply
    0
    • stackprogramerS Offline
      stackprogramerS Offline
      stackprogramer
      wrote on last edited by stackprogramer
      #2

      i concluded that we should define a property like fg in NumberAnimation
      and we have property int fg:menuspiral.width/3 in type Window

      now it works.

      NumberAnimation on x {
      property int fg
                    duration:2000
                    loops: Animation.Infinite
                    running:true
                    from: 0; to:fg
                }
      
      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