Putting our marquee control on our display.
authorsl
Mon, 02 Jun 2014 21:56:03 +0200
changeset 288297924aa384
parent 27 3d3f781bf543
child 29 a42cc76a2d5a
Putting our marquee control on our display.
MarqueeText.qml
TestsTab.qml
     1.1 --- a/MarqueeText.qml	Mon Jun 02 18:52:31 2014 +0200
     1.2 +++ b/MarqueeText.qml	Mon Jun 02 21:56:03 2014 +0200
     1.3 @@ -1,27 +1,32 @@
     1.4  import QtQuick 2.2
     1.5 +import QtQuick.Controls 1.2
     1.6  
     1.7  Item {
     1.8 -    id:marqueeText
     1.9 +    id:item
    1.10      height: scrollingText.height
    1.11      clip: true
    1.12 +    antialiasing: false
    1.13      property int pixelsPerSeconds:25
    1.14      property alias text: scrollingText.text
    1.15      property alias separator: separatorText.text
    1.16  
    1.17 -    Text {
    1.18 +    Label {
    1.19          id:scrollingText
    1.20 +        antialiasing: item.antialiasing
    1.21      }
    1.22  
    1.23 -    Text {
    1.24 +    Label {
    1.25          id:separatorText
    1.26          text:" || "
    1.27          x:scrollingText.x+scrollingText.width
    1.28 +        antialiasing: item.antialiasing
    1.29      }
    1.30  
    1.31 -    Text {
    1.32 +    Label {
    1.33          id:followingText
    1.34          text:scrollingText.text
    1.35          x:scrollingText.x+scrollingText.width+separatorText.width
    1.36 +        antialiasing: item.antialiasing
    1.37      }
    1.38  
    1.39      ParallelAnimation {
     2.1 --- a/TestsTab.qml	Mon Jun 02 18:52:31 2014 +0200
     2.2 +++ b/TestsTab.qml	Mon Jun 02 21:56:03 2014 +0200
     2.3 @@ -51,6 +51,16 @@
     2.4              smooth: false
     2.5          }
     2.6  
     2.7 +        MarqueeText {
     2.8 +            width: 256
     2.9 +            pixelsPerSeconds:50
    2.10 +            anchors.verticalCenter: parent.verticalCenter
    2.11 +            anchors.horizontalCenter: parent.horizontalCenter
    2.12 +            text: "start ------ abcdefghijklmnopqrtaksdjfkdfjklsdjflksdjfklsjadfkljsad;flasjdlfjasdfjldsdfljf---- end"
    2.13 +            //text: "start ------ end"
    2.14 +            separator: " | "
    2.15 +        }
    2.16 +
    2.17          GridLayout {
    2.18              anchors.fill:parent
    2.19              anchors.margins: 6
    2.20 @@ -248,9 +258,9 @@
    2.21  
    2.22          //
    2.23          Rectangle {
    2.24 -            border.width: 2
    2.25 +            border.width: 1
    2.26              border.color: "black"
    2.27 -            color: "lightsteelblue"
    2.28 +            color: "white"
    2.29              anchors.horizontalCenter: parent.horizontalCenter
    2.30              width: 250
    2.31              height: text.height + 10