diff options
author | Nico Vertriest <nico.vertriest@qt.io> | 2016-12-13 12:55:40 +0100 |
---|---|---|
committer | Nico Vertriest <nico.vertriest@theqtcompany.com> | 2016-12-13 12:46:17 +0000 |
commit | 16c81bb0d493af00bc376784bcb7e03a4a037b04 (patch) | |
tree | b199473a95c1dba60d0358383cb456c209ef07ec /examples/quick/localstorage | |
parent | 97e4d5d5aeb0d415db18c075f905763ae5ba5f18 (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/localstorage')
-rw-r--r-- | examples/quick/localstorage/localstorage/Header.qml | 16 |
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 { |