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. Qt animation without Animation Framework

Qt animation without Animation Framework

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

    I need to update a QPixmap 1024x128 (math function paints a picture) 30...60 times a second and i don't want to use Animation Framework - i think that is overkill for this purpose. Frames cannot be pre-calculated and compiled to .gif .mp4 to play later, the "scene" is realtime and external data dependent.

    Should i use QTimer with 30...60 ticks per second (TPS) and call update() in timer SLOT? But QTimer is not syncronized with actual screen updates and QTimer is inaccurate. My QTimer rate may be too low (not smooth motion) or too high (eat too much CPU) - how to find good one? My experiments showed that i need different QTimer intervals for my linux and windows test machines to get smooth update: linux: 30 TPS, windows: 50...60 TPS (i see rugged motion if i set 1000/30 msec).

    Or maybe i mis-understood Animation Framework and actually it is very simple and appropriate for this task?

    1 Reply Last reply
    0
    • raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      Actually for most cases the animation framework saves you more work than doing the task without. But sometimes a simple QTimer can be even less work. Depending on what you want to do. But the animation framework never felt like overkill. All you would need is probably QVariantAnimation/QPropertyAnimation class nothing more.

      To come back to your problem. QTimer accuracy wont ever be that good on windows - or better said on non-real time systems. You may want to read "this thread":http://qt-project.org/forums/viewthread/5904.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      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