summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAaron McCarthy <aaron.mccarthy@nokia.com>2011-08-15 16:00:15 +1000
committerAaron McCarthy <aaron.mccarthy@nokia.com>2011-08-16 03:26:02 +0200
commit8db0a16406bcfd3adf38f53bcf623b0d60284e26 (patch)
tree10298da5bf10f97de269f3a38150c1da0054a209 /examples
parentb97380b0b7a7df99d35b53cc4f5eb972d47418b5 (diff)
downloadqtlocation-8db0a16406bcfd3adf38f53bcf623b0d60284e26.tar.gz
Hide contact details if not present.
Change-Id: I0617659da326cd69b9c7c978490753d30975cd20 Reviewed-on: http://codereview.qt.nokia.com/2936 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: abcd <qt_abcd1@ovi.com> Reviewed-by: Aaron McCarthy <aaron.mccarthy@nokia.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/declarative/qmlplaces/SearchResultDelegate.qml29
1 files changed, 25 insertions, 4 deletions
diff --git a/examples/declarative/qmlplaces/SearchResultDelegate.qml b/examples/declarative/qmlplaces/SearchResultDelegate.qml
index 2deaa4f4..1f9a8385 100644
--- a/examples/declarative/qmlplaces/SearchResultDelegate.qml
+++ b/examples/declarative/qmlplaces/SearchResultDelegate.qml
@@ -88,10 +88,31 @@ Rectangle {
onLinkActivated: mediaGrid.model = result.place.mediaModel
}
- Text { text: result.place.primaryPhone.length == 0 ? '':'<b>Phone: </b> ' + result.place.primaryPhone; font.pixelSize: 16 }
- Text { text: result.place.primaryFax.length == 0 ? '':'<b>Fax: </b> ' + result.place.primaryFax; font.pixelSize: 16 }
- Text { text: result.place.primaryEmail.length == 0 ? '':'<b>Email: </b> ' + result.place.primaryEmail; font.pixelSize: 16 }
- Text { text: String(result.place.primaryUrl).length == 0 ? '':'<b>Website: </b> ' + result.place.primaryUrl; font.pixelSize: 16 }
+ Text {
+ text: '<b>Phone: </b> ' + result.place.primaryPhone
+ font.pixelSize: 16
+ visible: result.place.primaryPhone.length > 0
+ }
+
+ Text {
+ text: '<b>Fax: </b> ' + result.place.primaryFax
+ font.pixelSize: 16
+ visible: result.place.primaryFax.length > 0
+ }
+
+ Text {
+ text: '<b>Email: </b> ' + result.place.primaryEmail
+ font.pixelSize: 16
+ visible: result.place.primaryEmail.length > 0
+ }
+
+ Text {
+ text: '<b>Website: </b> <a href=\"' + result.place.primaryUrl + '\">' + result.place.primaryUrl + '</a>'
+ font.pixelSize: 16
+ visible: String(result.place.primaryUrl).length > 0
+ onLinkActivated: Qt.openUrlExternally(result.place.primaryUrl)
+ }
+
Text { text: '<b>Tags: </b> ' + result.place.tags; font.pixelSize: 16 }
//Text { text: '<b>Suppliers: </b> ' + JSON.stringify(place.suppliers); font.pixelSize: 16 }
Text { id: detailsFetched; text:'<b>Details Fetched: </b> ' + result.place.detailsFetched; font.pixelSize: 16 }