使用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
聯繫方式:
作者 | 鄭天佐 |
---|---|
278969898 | |
主頁 | http://www.camelstudio.cn/ |
郵箱 | [email protected] |
博客 | http://blog.csdn.net/zhengtianzuo06/ |
github | https://github.com/zhengtianzuo |
QQ羣 | 199672080 |
捐贈