小编PhB*_*Bsa的帖子

如何更改“ Qt Quick-Control 2 RoundButton”的颜色

任何人都知道如何更改控件“ RoundButton”的颜色,该控件自2.1开始就存在于Qt控件中。

我尝试更改背景,但是如果我在该项目上放置“矩形”,则RoundButton会变成矩形,而我不知道要放置什么。

RoundButton {
    id: roundButton
    x: 243
    y: 244
    width: 20
    height: 20

    text: "ah"
    wheelEnabled: false

    background: Rectangle {
        color: "yellow"
        height: 50
        width: 50
    }
}
Run Code Online (Sandbox Code Playgroud)

qt qml qtquickcontrols2

3
推荐指数
1
解决办法
1921
查看次数

标签 统计

qml ×1

qt ×1

qtquickcontrols2 ×1