diff options
| author | Shawn Rutledge <shawn.rutledge@digia.com> | 2014-03-25 10:11:02 +0100 |
|---|---|---|
| committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-25 10:11:02 +0100 |
| commit | cc7c4ba902ae6ab3b5eba80d7075ad8d6183a7ec (patch) | |
| tree | 3533a1dee0103a35e1881fe2e9c7a73f6f2d95de /examples/quick/dialogs/systemdialogs | |
| parent | 76dd99c448ae69cb12a0465facc5dd743b94e624 (diff) | |
| parent | ff5d39f0a8f34cdb034df703e7b2a769c945e1ed (diff) | |
Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev
Diffstat (limited to 'examples/quick/dialogs/systemdialogs')
| -rw-r--r-- | examples/quick/dialogs/systemdialogs/CustomDialogs.qml | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/examples/quick/dialogs/systemdialogs/CustomDialogs.qml b/examples/quick/dialogs/systemdialogs/CustomDialogs.qml index 2a31147eb..389979ef5 100644 --- a/examples/quick/dialogs/systemdialogs/CustomDialogs.qml +++ b/examples/quick/dialogs/systemdialogs/CustomDialogs.qml @@ -39,7 +39,7 @@ ****************************************************************************/ import QtQuick 2.1 -import QtQuick.Controls 1.1 +import QtQuick.Controls 1.2 import QtQuick.Dialogs 1.2 import QtQuick.Layouts 1.1 import QtQuick.Window 2.0 @@ -102,6 +102,7 @@ Item { Layout.alignment: Qt.AlignHCenter SpinBox { id: answer + onEditingFinished: spinboxDialog.click(StandardButton.Ok) } Text { text: "m/s" @@ -111,6 +112,25 @@ Item { } } + Dialog { + id: dateDialog + modality: dialogModal.checked ? Qt.WindowModal : Qt.NonModal + title: customizeTitle.checked ? windowTitleField.text : "Choose a date" + onButtonClicked: console.log("clicked button " + clickedButton) + onAccepted: { + if (clickedButton == StandardButton.Ok) + lastChosen.text = "Accepted " + calendar.selectedDate.toLocaleDateString() + else + lastChosen.text = (clickedButton == StandardButton.Retry ? "(Retry)" : "(Ignore)") + } + + Calendar { + id: calendar + width: parent ? parent.width : implicitWidth + onDoubleClicked: dateDialog.click(StandardButton.Ok) + } + } + Column { anchors.fill: parent anchors.margins: 12 @@ -154,6 +174,7 @@ Item { buttons = StandardButton.Ok helloDialog.standardButtons = buttons spinboxDialog.standardButtons = buttons + dateDialog.standardButtons = buttons updating = false } @@ -257,6 +278,11 @@ Item { anchors.verticalCenter: parent.verticalCenter onClicked: spinboxDialog.open() } + Button { + text: "Date picker" + anchors.verticalCenter: parent.verticalCenter + onClicked: dateDialog.open() + } } } } |
