[Interest] Performance tips for 'ticker' animation?

Cornelius Hald hald at icandy.de
Mon Aug 5 11:49:19 CEST 2013


Hi guys,

I'm having a kiosk application displaying video and web content in
FullHD using QtQuick 2.1 on Linux Qt 5.1.

Now I've added a text ticker that sits at the bottom of the screen and
scrolls text from right to left.

If I only display the ticker, the animation is smooth. But as soon as I
play a video or display (static) web content in the background, the
ticker animation starts to stutter quite badly. Still the CPU load is
only around 30%.

Does anyone have some tips on how to improve the visual smoothness of
the ticker animation?

Below is the code I'm currently using to animate the ticker.

Thanks,
Conny


import QtQuick 2.1
Rectangle {
  id: root
  property alias text: text.text
  height: 100
  color: "red"

  Text {
    id: text
    text: "This is some ticker text that gets displayed whenever you're
seeing this ticker here, bla bla bla..."
    color: "white"
    font.pixelSize: 80
    anchors.verticalCenter: parent.verticalCenter

    NumberAnimation on x {
      from: root.width
      to: -text.width
      duration: text.width * 10
      loops: Animation.Infinite
      onFromChanged: restart()
    }
  }
}





More information about the Interest mailing list