Controles rápidos --8.progress bar

1 resultados

Aquí Insertar imagen Descripción

2 Introducción

barra de progreso común de control, espera personalizado.

3 código de control

3.1 SenProgressBar .qml

import QtQuick 2.12
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4

Rectangle {
    property int formWidth: 80
    property int formHeight: 20
    property real minValue: 0
    property real maxValue: 100

    width: formWidth
    height: formHeight
    border.width: 1
    border.color: "black"

    ProgressBar {
        id: proBarId
        width: formWidth - 2
        height: formHeight - 2
        anchors {
            verticalCenter: parent.verticalCenter
            horizontalCenter: parent.horizontalCenter
        }

        minimumValue: minValue
        maximumValue: maxValue
        style: ProgressBarStyle {
            background: Rectangle {
                color: "white"
            }
            progress: Rectangle {
                color: "lightgrey"

            }
        }
        value: 20
    }
}

3.2 main.qml

import QtQuick 2.12
import QtQuick.Window 2.12
import "./common" as SenCom

Window {
    visible: true
    width: 640
    height: 480
    title: qsTr("Hello World")

    SenCom.SenProgressBar {
        anchors.centerIn: parent
    }
}
Publicados 496 artículos originales · ganado elogios 601 · Vistas 1,55 millones +

Supongo que te gusta

Origin blog.csdn.net/qq_38880380/article/details/104357134
Recomendado
Clasificación