summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorabcd <amos.choy@nokia.com>2011-12-05 17:29:52 +1000
committerQt by Nokia <qt-info@nokia.com>2011-12-12 05:38:34 +0100
commit37ae79556ca71a7c29f342abb5d4324f766fdf52 (patch)
treec0fd1d97ff3432a0836cd47b4d6f3e5988ca86f3 /examples
parenta57de36ca7582bbf326950376d6f74ae2fa82112 (diff)
downloadqtlocation-37ae79556ca71a7c29f342abb5d4324f766fdf52.tar.gz
Let example demonstrate saving of contact details
Change-Id: Id887e408e8767937fc080a7d380a0169aade1551 Reviewed-by: Aaron McCarthy <aaron.mccarthy@nokia.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/declarative/places/content/places/PlaceDialog.qml28
1 files changed, 25 insertions, 3 deletions
diff --git a/examples/declarative/places/content/places/PlaceDialog.qml b/examples/declarative/places/content/places/PlaceDialog.qml
index 6110a59c..1b157c48 100644
--- a/examples/declarative/places/content/places/PlaceDialog.qml
+++ b/examples/declarative/places/content/places/PlaceDialog.qml
@@ -82,7 +82,11 @@ Dialog {
["Country", place ? place.location.address.country : ""],
["Postal code", place ? place.location.address.postalCode : ""],
["Latitude", latitude()],
- ["Longitude", longitude()]
+ ["Longitude", longitude()],
+ ["Phone", place ? place.primaryPhone : ""],
+ ["Fax", place ? place.primaryFax : ""],
+ ["Email", place ? place.primaryEmail : ""],
+ ["Website", place ? place.primaryWebsite.toString() : ""]
]);
}
@@ -104,9 +108,27 @@ Dialog {
modifiedPlace.location.coordinate.latitude = parseFloat(dialogModel.get(9).inputText);
modifiedPlace.location.coordinate.longitude = parseFloat(dialogModel.get(10).inputText);
- place = modifiedPlace;
+ var phone = Qt.createQmlObject('import QtLocation 5.0; ContactDetail { }', modifiedPlace);
+ phone.label = "Phone";
+ phone.value = dialogModel.get(11).inputText;
+ modifiedPlace.contactDetails.phone = phone;
- place.save();
+ var fax = Qt.createQmlObject('import QtLocation 5.0; ContactDetail { }', modifiedPlace);
+ fax.label = "Fax";
+ fax.value = dialogModel.get(12).inputText;
+ modifiedPlace.contactDetails.fax = fax;
+
+ var email = Qt.createQmlObject('import QtLocation 5.0; ContactDetail { }', modifiedPlace);
+ email.label = "Email";
+ email.value = dialogModel.get(13).inputText;
+ modifiedPlace.contactDetails.email = email;
+
+ var website = Qt.createQmlObject('import QtLocation 5.0; ContactDetail { }', modifiedPlace);
+ website.label = "Website";
+ website.value = dialogModel.get(14).inputText;
+ modifiedPlace.contactDetails.website = website;
+
+ modifiedPlace.save();
}
//! [Place save]
}