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. QtQuick 2 animation performance issue
Forum Updated to NodeBB v4.3 + New Features

QtQuick 2 animation performance issue

Scheduled Pinned Locked Moved QML and Qt Quick
6 Posts 3 Posters 1.8k 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.
  • D Offline
    D Offline
    dvolosnykh
    wrote on last edited by
    #1

    Consider example below:

    @
    import QtQuick 2.0

    PathView {
    width: 1280
    height: 720
    cacheItemCount: 7
    pathItemCount: 7
    preferredHighlightBegin: 0.5
    preferredHighlightEnd: 0.5
    model: ListModel {
    ListElement {
    color: "orange"
    text: "first"
    }
    ListElement {
    color: "lightgreen"
    text: "second"
    }
    ListElement {
    color: "orchid"
    text: "third"
    }
    ListElement {
    color: "tomato"
    text: "fourth"
    }
    ListElement {
    color: "skyblue"
    text: "fifth"
    }
    ListElement {
    color: "hotpink"
    text: "sixth"
    }
    ListElement {
    color: "darkseagreen"
    text: "seventh"
    }
    ListElement {
    color: "salmon"
    text: "eightth"
    }
    ListElement {
    color: "darkolivegreen"
    text: "nineth"
    }
    ListElement {
    color: "navy"
    text: "tenth"
    }
    }
    delegate: Item {
    width: 150
    height: 150

        Rectangle {
            id: rect
            anchors.fill: parent
            color: model.color
            opacity: 0.8
        }
    
        Text {
            anchors.centerIn: parent
            text: model.text
            color: "white"
            font.pixelSize: 24
        }
    }
    path: Path {
        startX: -150
        startY: height / 2
        PathLine {
            x: width + 150
            relativeY: 0
        }
    }
    
    NumberAnimation on offset {
        from: 0
        to: count
        loops: Animation.Infinite
        duration: 4000
        Component.onCompleted: start()
    }
    

    }
    @

    The animation is jerky for Qt versions 5.1.1 and 5.3.2 (Ubuntu 14.04), and 5.2.1 (embedded Linux). I guess, this is the garbage collector affecting performance, but since UI structure does not change such suggestion might be irrelevant. Is there anything can be done to make animation run smoothly?

    1 Reply Last reply
    0
    • GianlucaG Offline
      GianlucaG Offline
      Gianluca
      wrote on last edited by
      #2

      Strange usage of "offset" property. From what I know should be used only for setting the initial configuration of the PathView.
      Try to animate the currentIndex property.

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dvolosnykh
        wrote on last edited by
        #3

        Interesting, I don't experience this issue on Mac OS X 10.10.

        1 Reply Last reply
        0
        • T Offline
          T Offline
          Torgeir
          wrote on last edited by
          #4

          This seems smooth to my eyes in both Windows 7 and Kubuntu 14.10.

          Is the jerkyness very subtle? If not, can you check if any processes are possibly loading your CPU? Is vsync enabled or disabled?

          Anyway I really do not think QML garbage collection plays any part in this performance.

          1 Reply Last reply
          0
          • D Offline
            D Offline
            dvolosnykh
            wrote on last edited by
            #5

            I've checked that on Windows 7 and its rather smooth, too, even that it runs on 10 years old laptop.

            Jerkyness is easily noticeable and reproduces constantly and consistently: extremely jerky at the very start of the application and then it becomes acceptably smooth with periodical (approximately over a constant time period) freezes for a short time.

            Veryfied issue on Ubuntu 12.04 laptop. Sync to VBlank is enabled in NVIDIA X Server Settings.

            1 Reply Last reply
            0
            • D Offline
              D Offline
              dvolosnykh
              wrote on last edited by
              #6

              I've updated my video graphics adapter driver to the most recent version, and now animation is rather smooth, except for some flickering.

              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