qml ProgressBar ProgressBarStyle 实现进度条

                        ProgressBar 
                        {
                            anchors.horizontalCenter: parent.horizontalCenter
                            anchors.top: parent.top
                            anchors.topMargin: 90
                            height: 4
                            width: parent.width - 34
                            indeterminate: false
                            value: 50
                            orientation: Qt.Horizontal
                            maximumValue : 0
                            minimumValue : 100
                            style: ProgressBarStyle {
                                background: Rectangle {
                                    radius: 2
                                    color: "#CCCACA"
                                    implicitWidth: 4
                                    implicitHeight: 4
                                }
                                progress: Rectangle {
                                    radius: 2
                                    color: "#5F5F5F"
                                }
                            }
                        }
注意需要导入
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles      1.4

猜你喜欢

转载自blog.csdn.net/caicai_xiaobai/article/details/132190257