import QtQuick 2.15 import QtQuick.Window 2.15 import QtQuick.Controls 2.5 import QtQuick.Dialogs 1.3 Window { width: 640 height: 480 visible: true title: qsTr("Hello World") Rectangle { id: rect width: 200 height: width anchors.centerIn: parent border.color: "black" border.width: 8 color: dialog.color } Button { anchors.top: rect.bottom anchors.horizontalCenter: parent.horizontalCenter text: "Show Dialog" onClicked: { dialog.open() } } ColorDialog { id: dialog title: "Please Choose a Color" color: "white" showAlphaChannel: true } }