Frame culling now done in QML rather than CPP.
2 import QtQuick.Controls 1.2
6 height: scrollingText.height
9 property int pixelsPerSeconds:25
10 property alias text: scrollingText.text
11 property alias separator: separatorText.text
15 antialiasing: item.antialiasing
21 x:scrollingText.x+scrollingText.width
22 antialiasing: item.antialiasing
27 text:scrollingText.text
28 x:scrollingText.x+scrollingText.width+separatorText.width
29 antialiasing: item.antialiasing
34 loops: Animation.Infinite;
35 //Reset to zero and restart onStopped so that we keep looping
36 //onStopped: {scrollingText.x=0;running=true;}
39 target: scrollingText;
41 from: scrollingText.x;
42 to: scrollingText.x-scrollingText.width-separatorText.width;
43 duration: (scrollingText.width+separatorText.width)*1000/pixelsPerSeconds
47 target: separatorText;
49 from: separatorText.x;
50 to: separatorText.x-scrollingText.width-separatorText.width;
51 duration: (scrollingText.width+separatorText.width)*1000/pixelsPerSeconds
55 target: followingText;
57 from: followingText.x;
58 to: followingText.x-scrollingText.width-separatorText.width;
59 duration: (scrollingText.width+separatorText.width)*1000/pixelsPerSeconds
69 animation.running=!animation.running;