diff options
Diffstat (limited to 'examples/quick/scenegraph/graph/main.qml')
-rw-r--r-- | examples/quick/scenegraph/graph/main.qml | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/examples/quick/scenegraph/graph/main.qml b/examples/quick/scenegraph/graph/main.qml index e9b684c3ba..5f2abbbd58 100644 --- a/examples/quick/scenegraph/graph/main.qml +++ b/examples/quick/scenegraph/graph/main.qml @@ -15,27 +15,23 @@ Item { anchors.margins: 100 function newSample(i) { - return (Math.sin(i / 100.0 * Math.PI * 2) + 1) * 0.4 + Math.random() * 0.05; + return (Math.sin(i / 200.0 * Math.PI * 2) + 1) * 0.4 + Math.random() * 0.05; } Component.onCompleted: { - for (var i=0; i<100; ++i) + for (var i=0; i<graph.offset; ++i) appendSample(newSample(i)); } - property int offset: 100; + property int offset: 200 } - Timer { - id: timer - interval: 500 - repeat: true + FrameAnimation { running: true onTriggered: { graph.removeFirstSample(); graph.appendSample(graph.newSample(++graph.offset)); } - } Rectangle { |