diff options
Diffstat (limited to 'examples/quick/demos/stocqt/content/DatePicker.qml')
-rw-r--r-- | examples/quick/demos/stocqt/content/DatePicker.qml | 138 |
1 files changed, 69 insertions, 69 deletions
diff --git a/examples/quick/demos/stocqt/content/DatePicker.qml b/examples/quick/demos/stocqt/content/DatePicker.qml index 82d8788bd9..d045d12d5e 100644 --- a/examples/quick/demos/stocqt/content/DatePicker.qml +++ b/examples/quick/demos/stocqt/content/DatePicker.qml @@ -41,82 +41,82 @@ import QtQuick 2.0 Rectangle { - id:root - color:"transparent" - width:300 - height:45 - property var _monthNames : [ "JAN", "FEB", "MAR", "APR", "MAY", "JUN","JUL", "AUG", "SEP", "OCT", "NOV", "DEC" ]; - property var date:new Date() + id: root + color: "transparent" + width: 300 + height: 45 + property var _monthNames: [ "JAN", "FEB", "MAR", "APR", "MAY", "JUN","JUL", "AUG", "SEP", "OCT", "NOV", "DEC" ]; + property var date: new Date() - onDateChanged: { - month.text = root._monthNames[root.date.getMonth()] - day.text = date.getDate(); - year.text = date.getFullYear(); - } - Row { - spacing:20 - anchors.fill:parent + onDateChanged: { + month.text = root._monthNames[root.date.getMonth()]; + day.text = date.getDate(); + year.text = date.getFullYear(); + } + Row { + spacing: 20 + anchors.fill: parent - Rectangle { - height:root.height - width:root.width/3 - 20 - color:"#272822" - radius:5 + Rectangle { + height: root.height + width: root.width/3 - 20 + color: "#272822" + radius: 5 - TextInput { - id:month - anchors.centerIn:parent - color:"#ecc089" - font.pointSize:25 - font.bold:true - text:root._monthNames[root.date.getMonth()] - onAccepted : { - for (var i = 0; i < 12; i++) { - if (text === root._monthNames[i]) { - root.date.setMonth(i); - root.date = root.date; - return; - } - } - root.date = root.date; + TextInput { + id: month + anchors.centerIn: parent + color: "#ecc089" + font.pointSize: 25 + font.bold: true + text: root._monthNames[root.date.getMonth()] + onAccepted: { + for (var i = 0; i < 12; i++) { + if (text === root._monthNames[i]) { + root.date.setMonth(i); + root.date = root.date; + return; + } + } + root.date = root.date; + } + } } - } - } - Rectangle { - height:root.height - width:root.width/3 - 20 - color:"#272822" - radius:5 + Rectangle { + height: root.height + width: root.width/3 - 20 + color: "#272822" + radius: 5 - TextInput { - id:day - anchors.centerIn:parent - color:"#ecc089" - font.pointSize:25 - font.bold:true - text:root.date.getDate() - validator:IntValidator {bottom:1; top:31} - onAccepted: { root.date.setDate(text); root.date = root.date;} - } - } + TextInput { + id: day + anchors.centerIn: parent + color: "#ecc089" + font.pointSize: 25 + font.bold: true + text: root.date.getDate() + validator:IntValidator {bottom: 1; top: 31} + onAccepted: { root.date.setDate(text); root.date = root.date;} + } + } - Rectangle { - height:root.height - width:root.width/3 - 20 - color:"#272822" - radius:5 + Rectangle { + height: root.height + width: root.width/3 - 20 + color: "#272822" + radius: 5 - TextInput { - id:year - anchors.centerIn:parent - color:"#ecc089" - font.pointSize:25 - font.bold:true - text:root.date.getFullYear() - validator:IntValidator {bottom:1995; top:(new Date()).getFullYear()} - onAccepted:{ root.date.setFullYear(text); root.date = root.date;} - } + TextInput { + id: year + anchors.centerIn: parent + color: "#ecc089" + font.pointSize: 25 + font.bold: true + text: root.date.getFullYear() + validator: IntValidator {bottom: 1995; top: (new Date()).getFullYear()} + onAccepted:{ root.date.setFullYear(text); root.date = root.date;} + } + } } - } } |