From b6fbc5c6dc609ecd39fdb8ff416f4d90ddd0acad Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Wed, 25 Feb 2015 13:39:34 +0100 Subject: 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 --- .../positioning/geoflickr/flickrmobile/GeoTab.qml | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'examples/positioning/geoflickr') 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; } + } + } } -- cgit v1.2.3