summaryrefslogtreecommitdiffstats
path: root/examples/quick
diff options
context:
space:
mode:
authorNico Vertriest <nico.vertriest@qt.io>2016-12-13 12:55:40 +0100
committerNico Vertriest <nico.vertriest@theqtcompany.com>2016-12-13 12:46:17 +0000
commit16c81bb0d493af00bc376784bcb7e03a4a037b04 (patch)
treeb199473a95c1dba60d0358383cb456c209ef07ec /examples/quick
parent97e4d5d5aeb0d415db18c075f905763ae5ba5f18 (diff)
Example: correction initialization fields Header.qml
Error msg: Can't assign to existing role 'distance' of different type [String -> Number] Change-Id: I28842ed25a56077e52496a229294ef992406ca1d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'examples/quick')
-rw-r--r--examples/quick/localstorage/localstorage/Header.qml16
1 files changed, 8 insertions, 8 deletions
diff --git a/examples/quick/localstorage/localstorage/Header.qml b/examples/quick/localstorage/localstorage/Header.qml
index e0e465ebc9..a08645a170 100644
--- a/examples/quick/localstorage/localstorage/Header.qml
+++ b/examples/quick/localstorage/localstorage/Header.qml
@@ -52,22 +52,22 @@ Item {
}
function initrec_new() {
- dateInput.text = ""
- descInput.text = ""
- distInput.text = ""
+ dateInput.clear()
+ descInput.clear()
+ distInput.clear()
listView.model.insert(0, {
date: "",
trip_desc: "",
- distance: ""
+ distance: 0
})
listView.currentIndex = 0
dateInput.forceActiveFocus()
}
function initrec() {
- dateInput.text = ""
- descInput.text = ""
- distInput.text = ""
+ dateInput.clear()
+ descInput.clear()
+ distInput.clear()
}
function setlistview() {
@@ -76,7 +76,7 @@ Item {
listView.model.setProperty(listView.currentIndex, "trip_desc",
descInput.text)
listView.model.setProperty(listView.currentIndex, "distance",
- distInput.text)
+ parseInt(distInput.text,10))
}
Rectangle {