diff options
Diffstat (limited to 'examples/quick/dialogs/ColorDialogs.qml')
-rw-r--r-- | examples/quick/dialogs/ColorDialogs.qml | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/examples/quick/dialogs/ColorDialogs.qml b/examples/quick/dialogs/ColorDialogs.qml index 7817c8edf8..6a0af7f730 100644 --- a/examples/quick/dialogs/ColorDialogs.qml +++ b/examples/quick/dialogs/ColorDialogs.qml @@ -46,9 +46,10 @@ Rectangle { width: 320 height: 200 color: palette.window - SystemPalette { id: palette } + clip: true + //! [colordialog] ColorDialog { id: colorDialog visible: colorDialogVisible.checked @@ -59,10 +60,11 @@ Rectangle { onAccepted: { console.log("Accepted: " + color) } onRejected: { console.log("Rejected") } } + //! [colordialog] Column { anchors.fill: parent - anchors.margins: 8 + anchors.margins: 12 spacing: 8 Text { font.bold: true @@ -106,4 +108,38 @@ Rectangle { } } } + + Rectangle { + anchors { + left: parent.left + right: parent.right + bottom: parent.bottom + } + height: 50 + color: Qt.darker(palette.window, 1.1) + border.color: Qt.darker(palette.window, 1.3) + Row { + spacing: 6 + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + anchors.leftMargin: 12 + height: parent.height - 6 + width: parent.width + Button { + text: "Open" + anchors.verticalCenter: parent.verticalCenter + onClicked: colorDialog.open() + } + Button { + text: "Close" + anchors.verticalCenter: parent.verticalCenter + onClicked: colorDialog.close() + } + Button { + text: "set to green" + anchors.verticalCenter: parent.verticalCenter + onClicked: colorDialog.color = "green" + } + } + } } |