查看完整版本: [-- zhengtianzuo系列-Qml选择颜色对话框 --]

QTCN开发网 -> Qt代码秀 -> zhengtianzuo系列-Qml选择颜色对话框 [打印本页] 登录 -> 注册 -> 回复主题 -> 发表主题

zhengtianzuo 2017-12-09 16:01

zhengtianzuo系列-Qml选择颜色对话框

使用Qt.labs.platform 1.0中的ColorDialog
代码非常的简单

```
ApplicationWindow {
    id: root
    visible: true
    width: 400
    height: 300
    title: qsTr("Qml选择颜色对话框")
    color: colorDialog.color

    Button{
        text: qsTr("选择颜色")
        height: 48
        width: 120
        anchors.centerIn: parent
        MouseArea{
            anchors.fill: parent
            onClicked: {
                colorDialog.open();
            }
        }
    }

    ColorDialog {
        id: colorDialog
        title: qsTr("选择颜色")
        color: "#AAAAAA"
    }
}
```



需要完整代码请访问 QtQuickExamples

big_mouse 2020-04-23 09:17


查看完整版本: [-- zhengtianzuo系列-Qml选择颜色对话框 --] [-- top --]



Powered by phpwind v8.7 Code ©2003-2011 phpwind
Gzip disabled