# HG changeset patch # User sl # Date 1401710845 -7200 # Node ID aec049087578b71c01ddb9a56acde75ee739ac3e # Parent 783a937d3eb3b55d91c896aa676b5eaf65832399 Adding scrolling marquee text demo. diff -r 783a937d3eb3 -r aec049087578 Manager.pro --- a/Manager.pro Sun Jun 01 21:34:29 2014 +0200 +++ b/Manager.pro Mon Jun 02 14:07:25 2014 +0200 @@ -24,4 +24,5 @@ TestsTab.qml \ DisplayTab.qml \ DisplayStatusBar.qml \ - DisplayFrame.qml + DisplayFrame.qml \ + MarqueeText.qml diff -r 783a937d3eb3 -r aec049087578 MarqueeText.qml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MarqueeText.qml Mon Jun 02 14:07:25 2014 +0200 @@ -0,0 +1,44 @@ +import QtQuick 2.2 + +Item { + id:marqueeText + height: scrollingText.height + clip: true + property int tempX: 0 + property alias text: scrollingText.text + Text { + x: tempX + id:scrollingText + } + + MouseArea { + id:mouseArea + anchors.fill: parent + onClicked: { + tempX = 0; + timer.running = true; + } + } + + Timer { + id:timer + interval: 33; running: false; repeat: true + onTriggered:{ + tempX = tempX + 1 + scrollingText.x = -tempX; + + if( tempX + marqueeText.width > scrollingText.width ) { + timer.running = false + pauseTimer.running = true + } + } + } + + Timer { + id:pauseTimer + interval: 500; running: false; repeat: false + onTriggered: { + scrollingText.x = 0 + } + } +} diff -r 783a937d3eb3 -r aec049087578 TestsTab.qml --- a/TestsTab.qml Sun Jun 01 21:34:29 2014 +0200 +++ b/TestsTab.qml Mon Jun 02 14:07:25 2014 +0200 @@ -246,5 +246,23 @@ onCheckedChanged: {display.frameDifferencing = checked;} } + // + Rectangle { + border.width: 2 + border.color: "black" + color: "lightsteelblue" + anchors.horizontalCenter: parent.horizontalCenter + width: 250 + height: text.height + 10 + y:100 + MarqueeText { + id:text + width: 200 + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + text: "start ------ abcdefghijklmnopqrtaksdjfkdfjklsdjflksdjfklsjadfkljsad;flasjdlfjasdfjldsdfljf---- end" + } + } + } } diff -r 783a937d3eb3 -r aec049087578 qml.qrc --- a/qml.qrc Sun Jun 01 21:34:29 2014 +0200 +++ b/qml.qrc Mon Jun 02 14:07:25 2014 +0200 @@ -6,5 +6,6 @@ DisplayTab.qml DisplayStatusBar.qml DisplayFrame.qml + MarqueeText.qml