SHOW:
|
|
- or go back to the newest paste.
| 1 | import QtQuick 2.0 | |
| 2 | import Sailfish.Silica 1.0 | |
| 3 | ||
| 4 | ||
| 5 | Page {
| |
| 6 | id: page | |
| 7 | ||
| 8 | // To enable PullDownMenu, place our content in a SilicaFlickable | |
| 9 | SilicaFlickable {
| |
| 10 | anchors.fill: parent | |
| 11 | ||
| 12 | // PullDownMenu and PushUpMenu must be declared in SilicaFlickable, SilicaListView or SilicaGridView | |
| 13 | PullDownMenu {
| |
| 14 | MenuItem {
| |
| 15 | text: "Show Page 2" | |
| 16 | onClicked: pageStack.push(Qt.resolvedUrl("SecondPage.qml"))
| |
| 17 | } | |
| 18 | } | |
| 19 | ||
| 20 | // Tell SilicaFlickable the height of its content. | |
| 21 | contentHeight: column.height | |
| 22 | ||
| 23 | // Place our content in a Column. The PageHeader is always placed at the top | |
| 24 | // of the page, followed by our content. | |
| 25 | Column {
| |
| 26 | id: column | |
| 27 | ||
| 28 | width: page.width | |
| 29 | spacing: Theme.paddingLarge | |
| 30 | PageHeader {
| |
| 31 | title: "Age Calculator" | |
| 32 | } | |
| 33 | - | |
| 33 | + | |
| 34 | - | |
| 34 | + | |
| 35 | Button {
| |
| 36 | id: button | |
| 37 | text: "Choose a date" | |
| 38 | ||
| 39 | onClicked: {
| |
| 40 | var dialog = pageStack.push("Sailfish.Silica.DatePickerDialog", {
| |
| 41 | date: new Date('2012/11/23')
| |
| 42 | }) | |
| 43 | dialog.accepted.connect(function() {
| |
| 44 | button.text = "You chose: " + dialog.dateText | |
| 45 | }) | |
| 46 | } | |
| 47 | } | |
| 48 | ||
| 49 | Label{
| |
| 50 | text: "date: " + dialog.day | |
| 51 | } | |
| 52 | } | |
| 53 | } | |
| 54 | } |