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

 1 Window {
 2     visible: true
 3      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                control.availableWidth
16               height: implicitHeight
17               radius: 2
18               color: "#bdbebf"
19               Rectangle {
20                    0.8* parent.width
21                   height: parent.height
22                   color: "red"
23                   radius: 2
24               }
25               Rectangle {
26                    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                    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 }

效果图:

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