Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/qt/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Qt 如何更改QML拨号中的循环进度条?_Qt_Qml_Progress Bar_Qt5 - Fatal编程技术网

Qt 如何更改QML拨号中的循环进度条?

Qt 如何更改QML拨号中的循环进度条?,qt,qml,progress-bar,qt5,Qt,Qml,Progress Bar,Qt5,我在更改QML拨号组件中的进度条颜色时遇到问题。我试着用帆布,但最后什么也没做。有什么建议或例子吗 Dial { value: 0.5 anchors.horizontalCenter: parent.horizontalCenter } 黑色进度条 如中所示,您可以使用调色板,为此,您可以检查,因此解决方案是: import QtQuick 2.9 import QtQuick.Window 2.2 import QtQuick.Controls 2.5 Window {

我在更改QML拨号组件中的进度条颜色时遇到问题。我试着用帆布,但最后什么也没做。有什么建议或例子吗

Dial {
    value: 0.5
    anchors.horizontalCenter: parent.horizontalCenter
}
黑色进度条

如中所示,您可以使用调色板,为此,您可以检查,因此解决方案是:

import QtQuick 2.9
import QtQuick.Window 2.2
import QtQuick.Controls 2.5

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

    Dial {
        // @disable-check M17
        palette.dark: "red"
        value: .5
        anchors.centerIn: parent
    }
}

更改项目颜色的另一种方法是ColorOverlay,它支持RGBA

import QtQuick 2.9
import QtQuick.Window 2.2
import QtQuick.Controls 2.5
import QtGraphicalEffects 1.12

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

    Dial {
        id: dial
        value: .5
        anchors.centerIn: parent
    }

    ColorOverlay {
        anchors.fill: dial
        source: dial
        color: "#80800000"
    }
}