From 16c81bb0d493af00bc376784bcb7e03a4a037b04 Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Tue, 13 Dec 2016 12:55:40 +0100 Subject: 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 --- examples/quick/localstorage/localstorage/Header.qml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'examples/quick') 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 { -- cgit v1.2.3