diff options
author | Shawn Rutledge <shawn.rutledge@digia.com> | 2014-04-09 09:52:52 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@digia.com> | 2014-08-24 10:27:54 +0200 |
commit | 737b7bec8513c23d1ea6bbbc88dbe6f357efb2fa (patch) | |
tree | 67911d7ff82bf73f5921825d5407d11d387b09ed | |
parent | 46e9a9a3a1a8399adef2be2af683a0321e8bc86c (diff) | |
download | qtquickcontrols-737b7bec8513c23d1ea6bbbc88dbe6f357efb2fa.tar.gz |
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 <liang.qi@digia.com>
-rw-r--r-- | examples/quick/dialogs/systemdialogs/CustomDialogs.qml | 24 |
1 files changed, 23 insertions, 1 deletions
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() + } } } } |