首页 > 其他 > 详细

qml实现音乐播放进度(播放进度,缓存进度,副歌)

时间:2019-05-23 19:31:21      阅读:189      评论:0      收藏:0      [点我收藏+]
 1 Window {
 2     visible: true
 3     width: 640
 4     height: 480
 5     title: qsTr("Hello World")
 6     Slider {
 7           id: control
 8           value: 0.5
 9 
10           background: Rectangle {
11               x: control.leftPadding
12               y: control.topPadding + control.availableHeight / 2 - height / 2
13               implicitWidth: 200
14               implicitHeight: 4
15               width: control.availableWidth
16               height: implicitHeight
17               radius: 2
18               color: "#bdbebf"
19               Rectangle {
20                   width: 0.8* parent.width
21                   height: parent.height
22                   color: "red"
23                   radius: 2
24               }
25               Rectangle {
26                   width: control.visualPosition * parent.width
27                   height: parent.height
28                   color: "#21be2b"
29                   radius: 2
30               }
31               Rectangle {
32                   x:control.width/2-40
33                   y: -3
34                   width: 10
35                   height: 10
36                   color: "green"
37                   radius: 5
38               }
39 
40           }
41 
42           handle: Rectangle {
43               x: control.leftPadding + control.visualPosition * (control.availableWidth - width)
44               y: control.topPadding + control.availableHeight / 2 - height / 2
45               implicitWidth: 26
46               implicitHeight: 26
47               radius: 13
48               color: control.pressed ? "yellow" : "#f6f6f6"
49               border.color: "#bdbebf"
50           }
51       }
52 }

效果图:

技术分享图片

 

qml实现音乐播放进度(播放进度,缓存进度,副歌)

原文:https://www.cnblogs.com/wxmwanggood/p/10913829.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!