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. smooth animation
Forum Update on Monday, May 27th 2025

smooth animation

Scheduled Pinned Locked Moved QML and Qt Quick
animationsmooth
2 Posts 2 Posters 1.3k 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
    tmichael
    wrote on 24 Mar 2015, 19:19 last edited by
    #1

    I'm using QML 4.7

    I'm animating a panning background in my interface like so:

    		Image{
    			id: skylineLayer01
    			source: "skyline_layer01.png"
    			smooth: true
    		    NumberAnimation {
    				id: skylineLayer01_anim
    				target: skylineLayer01
    				properties: "x"
    				from: 0.0
    				to: 0.0 - (skylineLayer01.width-1080)
    				loops: Animation.Infinite
    				duration: 240 * 1000
    			}
    			Component.onCompleted:{
    				skylineLayer01_anim.start();
    			}
    		}
    

    The image is 3128px wide, so it's moving slowly... the animation is not smooth until I go down to something around a duration of 60 * 1000. However, I really need the slow animation and I need it to be smooth. I can't tell if maybe qml doesn't do subpixel rendering and that's what I'm seeing? or maybe it's an issue with synchronizing the animation and the frame rate? Can anyone help with this?

    Thanks!!

    1 Reply Last reply
    0
    • V Offline
      V Offline
      Vince Golubic
      wrote on 24 Mar 2015, 21:57 last edited by Vince Golubic
      #2

      I'm experimenting a bit with QML as we speak, but classically using standard Qt4/Qt5 you would have an EventTimer() (specified by some msec timer update) and a Paint() function that you can override in your Draw class doing the screen update. (Actually another approach is possible as well)

      But basically, inside the Paint() update you would do the drawing & animation needed. QML may have something similar in updatePaintNode().

      Hope that helps,
      -Vince

      1 Reply Last reply
      0

      1/2

      24 Mar 2015, 19:19

      • Login

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