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. How to keep the FPS stable at 60fps when using QML to draw animations
Forum Update on Monday, May 27th 2025

How to keep the FPS stable at 60fps when using QML to draw animations

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 2 Posters 1.7k 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
    QTAndy
    wrote on last edited by QTAndy
    #1

    Hi,
    I‘am developing an QT Cluster App by QML on an 8Gb Board like below:

    1. Using two QML's Canvas to draw Cluster animations
    2. Set QQuickWindow::setSceneGraphBackend(QSGRendererInterface::OpenGL)
    3. Calling method requestPaint() from c++ thread to render Cluster page per 16ms by asynchronous way.

    When running QT Cluster App, the FPS of Cluster is about 30-40fps and it is not stable. After tuning, we found there are some reasons caused the low FPS, the main reasons are below:

    1. Render rate(16ms)
    2. Multi Canvas

    But if we reduce the render rate to 100ms or more, although FPS will up to 60fps, but the QT Annimations looks very slow.
    So, I want to confirm that if there any way to keep my App's FPS stable at 60fps when setting the render frequency as 16ms .
    By the way, the OS and S/W are below:
    OS:

    1. QNX Hypervisor
    2. QXN Host(QT Cluster App) + Guest Android(IVI Launcher App)

    S/W:

    1. QT open source Library 5.11.2
    2. Qtcreator 4.11.1

    that's all.

    J.HilkJ 1 Reply Last reply
    0
    • Q Offline
      Q Offline
      QTAndy
      wrote on last edited by
      #2

      I tried the Qt5.14.2\Examples\Qt-5.14.2\quickcontrols\extras\dashboard in my enviornment. I fount it runs in scope 55-60fps.
      I found there is a module named "QT for mcu" in QT site. And I found some demos runs smoothly with it.
      Should I use the "QT for mcu" library to improve my Cluster app?

      1 Reply Last reply
      0
      • Q QTAndy

        Hi,
        I‘am developing an QT Cluster App by QML on an 8Gb Board like below:

        1. Using two QML's Canvas to draw Cluster animations
        2. Set QQuickWindow::setSceneGraphBackend(QSGRendererInterface::OpenGL)
        3. Calling method requestPaint() from c++ thread to render Cluster page per 16ms by asynchronous way.

        When running QT Cluster App, the FPS of Cluster is about 30-40fps and it is not stable. After tuning, we found there are some reasons caused the low FPS, the main reasons are below:

        1. Render rate(16ms)
        2. Multi Canvas

        But if we reduce the render rate to 100ms or more, although FPS will up to 60fps, but the QT Annimations looks very slow.
        So, I want to confirm that if there any way to keep my App's FPS stable at 60fps when setting the render frequency as 16ms .
        By the way, the OS and S/W are below:
        OS:

        1. QNX Hypervisor
        2. QXN Host(QT Cluster App) + Guest Android(IVI Launcher App)

        S/W:

        1. QT open source Library 5.11.2
        2. Qtcreator 4.11.1

        that's all.

        J.HilkJ Offline
        J.HilkJ Offline
        J.Hilk
        Moderators
        wrote on last edited by
        #3

        Hi @QTAndy

        using a Canvas element seems like one of the slowest way to implement custom drawings.

        have you considered subclassing
        https://doc.qt.io/qt-5/qquickitem.html
        or
        https://doc.qt.io/qt-5/qquickpainteditem.html

        and doing your drawing directly in updatePaintNode ?

        In theory, that should be a lot faster!


        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


        Q: What's that?
        A: It's blue light.
        Q: What does it do?
        A: It turns blue.

        Q 1 Reply Last reply
        1
        • J.HilkJ J.Hilk

          Hi @QTAndy

          using a Canvas element seems like one of the slowest way to implement custom drawings.

          have you considered subclassing
          https://doc.qt.io/qt-5/qquickitem.html
          or
          https://doc.qt.io/qt-5/qquickpainteditem.html

          and doing your drawing directly in updatePaintNode ?

          In theory, that should be a lot faster!

          Q Offline
          Q Offline
          QTAndy
          wrote on last edited by
          #4

          @J-Hilk
          Thanks for your reply.
          I tried Scene Graph and used QQuickItem's updatePaintNode().
          It works well. The FPS has been improved although it is still less than 60fps.
          But the edges of the graphic are jagged.
          I tried setAntialiasing(true) and setSmooth(true), but they don't seem to work.
          Is there any method to fix this issue?

          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