diff options
author | Jens Bache-Wiig <jens.bache-wiig@digia.com> | 2012-12-13 19:16:13 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-12-13 20:43:59 +0100 |
commit | 93c7cf2cbc650d1590037d86f8eba6d0be029159 (patch) | |
tree | e54a77727f885789222b3b6588b2015862a3f559 /examples/quick/demos/stocqt/content/DatePicker.qml | |
parent | 47d97fe72bff0bfd4e2a32ecb7850502cf0a82d5 (diff) |
Clean up the StockQt demo
I cleaned up the whitespace, property declarations and removed
some console output. No changes to the functionality or design.
Change-Id: I499f6d061e43bf2e187eebc026858b3abd21a9b0
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Reviewed-by: Alan Alpert <aalpert@rim.com>
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;} + } + } } - } } |