Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

Qlabel scrolling text

$
0
0
Keep in mind that moving UI elements tend to be rather distracting. Perhaps a tool tip / popup is a better solution to your problem. Anyway here is a simple marquee import QtQuick 2.0 import QtQuick.Controls 1.0   Rectangle {     width: 360     height: 360     Rectangle {         id: marquee         width: 100         height: label.height         color: "white"         clip: true         border.color: "lightgray"         anchors.centerIn: parent         Label {             id: label             x: 2             text: "Hello I am a very long label"             property int scrollLength: (label.implicitWidth - marquee.width) + 4             SequentialAnimation on x {                 loops: Animation.Infinite                 NumberAnimation { to: -label.scrollLength ; duration: 2000 ; easing.type: Easing.OutSine}                 PauseAnimation { duration: 1000 }                 NumberAnimation { to: 2 ; duration: 2000 ; easing.type: Easing.OutSine}                 PauseAnimation { duration: 1000 }             }         }     } }

Viewing all articles
Browse latest Browse all 4972

Trending Articles