summaryrefslogtreecommitdiffstats
path: root/examples/positioning/geoflickr
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@theqtcompany.com>2015-02-25 13:39:34 +0100
committerAlex Blasche <alexander.blasche@theqtcompany.com>2015-02-26 08:23:23 +0000
commitb6fbc5c6dc609ecd39fdb8ff416f4d90ddd0acad (patch)
tree1eee5b8513f5af30ce1959dce4ee9d8a17fe3995 /examples/positioning/geoflickr
parent29d5221f666aab83db010e7f4027e34804af020e (diff)
Add updateTimeout() signal to QML PositionSource type
QGeoPositionSource has such a signal which we need to forward to QML. Without it QML apps have no way to dertermine a timeout based failure situation. Task-number: QTBUG-44663 Change-Id: I1f8da6a61851b4a8302c9558dd2b4a9088be3de5 Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com>
Diffstat (limited to 'examples/positioning/geoflickr')
-rw-r--r--examples/positioning/geoflickr/flickrmobile/GeoTab.qml24
1 files changed, 24 insertions, 0 deletions
diff --git a/examples/positioning/geoflickr/flickrmobile/GeoTab.qml b/examples/positioning/geoflickr/flickrmobile/GeoTab.qml
index 52da1bfa..1226120d 100644
--- a/examples/positioning/geoflickr/flickrmobile/GeoTab.qml
+++ b/examples/positioning/geoflickr/flickrmobile/GeoTab.qml
@@ -93,6 +93,10 @@ Rectangle {
PositionSource {
id: positionSource
onPositionChanged: { planet.source = "images/sun.png"; }
+
+ onUpdateTimeout: {
+ activityText.fadeOut = true
+ }
}
//! [possrc]
function printableMethod(method) {
@@ -135,4 +139,24 @@ Rectangle {
anchors {left: planet.right; leftMargin: 5; verticalCenter: planet.verticalCenter}
text: "Source: " + printableMethod(positionSource.supportedPositioningMethods); style: Text.Raised; styleColor: "black";
}
+
+ Text {
+ id: activityText; color: "white"; font.bold: true;
+ anchors { top: planet.bottom; horizontalCenter: parent.horizontalCenter }
+ property bool fadeOut: false
+
+ text: {
+ if (fadeOut)
+ return qsTr("Timeout occurred!");
+ else if (positionSource.active)
+ return qsTr("Retrieving update...")
+ else
+ return ""
+ }
+
+ Timer {
+ id: fadeoutTimer; repeat: false; interval: 3000; running: activityText.fadeOut
+ onTriggered: { activityText.fadeOut = false; }
+ }
+ }
}