16,211
社区成员
发帖
与我相关
我的任务
分享
Rectangle{
id:rectText
x:100;y:200
width: 300;height: 20
border.color: "blue"
border.width: 2
clip:true
Text{
id:contentTextId
text:"dsfagdfsddddddnvhfghddddsdddddfgjhkmukhdddjhjhggdddddfgdfhdfyjfugkybnsfgbsrgrt"
font.pointSize: 10
NumberAnimation {
id:animText
target: contentTextId
property: "x"
duration: 15000
to:(contentTextId.text.length - rectText.width )
running: false
easing.type: Easing.OutCubic
}
}
MouseArea{
anchors.fill: parent
onClicked: {
animText.start()
}
}
}
你点击那个矩形框就可以看到text文本的滚动显示,当然你可以根据需要改变触发时机