[Qt-qml] jerky animation when using NumberAnimation

qt next qtnext at gmail.com
Fri Sep 10 11:30:00 CEST 2010


Hi,

I am trying to have smooth animation in my qml application with no succes
(Windows Seven x32, High graphic card, core i7,....60hz refresh screen
rate). It seems that it's not a perfomance issue but more a synchronisation
issue.
Here a small sample to demonstrate the jerky animation ( you need to start
this sample with a qdeclarativeview with opengl viewport to have a smooth
animation with the Timer) :


If Component.onCompleted :{anim.running=true;} is uncommented and the next
line commented .. you have a jerky movement (drop 2 times a seconds ...)
if Component.onCompleted :time.start; is uncommented and the previous line
commented you have a very smooth movement...

It seems that there is a big issue regarding animation : I have tryed to
recompile Qt changing in QAbstractAnimation.cpp : DEFAULT_TIMER_INTERVAL 16
to DEFAULT_TIMER_INTERVAL 1 or 10 or 5 but it change nothing .... I don't
what I can do to have a smooth qml animation... it's not possible for my
customer to have a jerky animation ...


@

import Qt 4.7

 Rectangle {

    id: rectangle

    width: 1920

    height: 1080

 Rectangle {

        id: rectangle1

        width: 1920

        height: 1080

         Timer

        {

            id :time

            interval: 5;

            running: true;

            repeat: true

            onTriggered:{ logo.y=logo.y+10;if(logo.y>800) logo.y=0;}

        }

         Rectangle

        {

            id: logo

            x: 264

            y: 0

            width : 100

            height :100

            color :"red"

            anchors.horizontalCenter: parent.horizontalCenter

            SequentialAnimation {

                id : anim

                 NumberAnimation { target: logo; property: "y";  to:
1080; duration: 1500; loops: Animation.Infinite}

             }

            Component.onCompleted:{anim.running=true; }

          //  Component.onCompleted :time.start();

        }

     }

 }

@
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20100910/657b4d81/attachment.html 


More information about the Qt-qml mailing list