From 737b7bec8513c23d1ea6bbbc88dbe6f357efb2fa Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Wed, 9 Apr 2014 09:52:52 +0200 Subject: Dialogs: buttonless fully-filled dialog example The default property "contentItem" is normally the parent of the added content, but you can set the content directly into the property to avoid having any buttons or margins. Task-number: QTBUG-38056 Change-Id: Ie0e96969b3e35f079b29a9f3f57eaaf16236d4c1 Reviewed-by: Liang Qi --- .../quick/dialogs/systemdialogs/CustomDialogs.qml | 24 +++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/examples/quick/dialogs/systemdialogs/CustomDialogs.qml b/examples/quick/dialogs/systemdialogs/CustomDialogs.qml index ffc3265b..405dece3 100644 --- a/examples/quick/dialogs/systemdialogs/CustomDialogs.qml +++ b/examples/quick/dialogs/systemdialogs/CustomDialogs.qml @@ -131,6 +131,24 @@ Item { } } + Dialog { + id: filledDialog + modality: dialogModal.checked ? Qt.WindowModal : Qt.NonModal + title: customizeTitle.checked ? windowTitleField.text : "Customized content" + contentItem: Rectangle { + color: "lightskyblue" + implicitWidth: 400 + implicitHeight: 100 + Text { + text: "Hello blue sky!" + color: "navy" + anchors.centerIn: parent + } + focus: true + Keys.onEscapePressed: filledDialog.close() + } + } + Column { anchors.fill: parent anchors.margins: 12 @@ -143,7 +161,6 @@ Item { CheckBox { id: dialogModal text: "Modal" - checked: true Binding on checked { value: helloDialog.modality != Qt.NonModal } } CheckBox { @@ -283,6 +300,11 @@ Item { anchors.verticalCenter: parent.verticalCenter onClicked: dateDialog.open() } + Button { + text: "Buttonless marginless dialog" + anchors.verticalCenter: parent.verticalCenter + onClicked: filledDialog.open() + } } } } -- cgit v1.2.1