diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2016-01-26 14:25:06 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2016-01-26 14:25:06 +0100 |
commit | c6a28570a7300788127117378eb7cd36dcd0953f (patch) | |
tree | b8e56b1bd18fb4438de171004d588d12dbf7abec /examples | |
parent | e9ead74ec4169d483de0b711986b5b560bbb730a (diff) | |
parent | 24e50e40caaa2f2e057180b8ed8179795e605e2a (diff) | |
download | qtlocation-c6a28570a7300788127117378eb7cd36dcd0953f.tar.gz |
Merge remote-tracking branch 'origin/5.6' into dev
Change-Id: I23c874c5dcd0452142c3cf8abff65415ad31a1e7
Diffstat (limited to 'examples')
-rw-r--r-- | examples/location/mapviewer/mapviewer.qml | 6 | ||||
-rw-r--r-- | examples/location/mapviewer/menus/MainMenu.qml | 2 | ||||
-rw-r--r-- | examples/positioning/weatherinfo/appmodel.cpp | 5 |
3 files changed, 13 insertions, 0 deletions
diff --git a/examples/location/mapviewer/mapviewer.qml b/examples/location/mapviewer/mapviewer.qml index 2cb4e0d0..929ea4ba 100644 --- a/examples/location/mapviewer/mapviewer.qml +++ b/examples/location/mapviewer/mapviewer.qml @@ -231,6 +231,12 @@ ApplicationWindow { stackView.currentItem.selectLanguage.connect(setLanguage) stackView.currentItem.closeForm.connect(stackView.closeForm) break + case "Clear": + map.clearData() + break + case "Prefetch": + map.prefetchData() + break default: console.log("Unsupported operation") } diff --git a/examples/location/mapviewer/menus/MainMenu.qml b/examples/location/mapviewer/menus/MainMenu.qml index 3dc3e9fb..7054c40d 100644 --- a/examples/location/mapviewer/menus/MainMenu.qml +++ b/examples/location/mapviewer/menus/MainMenu.qml @@ -125,6 +125,8 @@ MenuBar { item.triggered.connect(function() {toggleMapState("FollowMe")}) addItem(qsTr("Language")).triggered.connect(function(){selectTool("Language")}) + addItem(qsTr("Prefetch Map Data")).triggered.connect(function(){selectTool("Prefetch")}) + addItem(qsTr("Clear Map Data")).triggered.connect(function(){selectTool("Clear")}) } } } diff --git a/examples/positioning/weatherinfo/appmodel.cpp b/examples/positioning/weatherinfo/appmodel.cpp index a773cfca..4d8806b8 100644 --- a/examples/positioning/weatherinfo/appmodel.cpp +++ b/examples/positioning/weatherinfo/appmodel.cpp @@ -154,6 +154,7 @@ public: int minMsBeforeNewRequest; QTimer delayedCityRequestTimer; QTimer requestNewWeatherTimer; + QString app_ident; AppModelPrivate() : src(NULL), @@ -170,6 +171,7 @@ public: requestNewWeatherTimer.setSingleShot(false); requestNewWeatherTimer.setInterval(20*60*1000); // 20 min throttle.invalidate(); + app_ident = QStringLiteral("36496bad1955bf3365448965a42b9eac"); } }; @@ -304,6 +306,7 @@ void AppModel::queryCity() query.addQueryItem("lat", latitude); query.addQueryItem("lon", longitude); query.addQueryItem("mode", "json"); + query.addQueryItem("APPID", d->app_ident); url.setQuery(query); qCDebug(requestsLog) << "submitting request"; @@ -385,6 +388,7 @@ void AppModel::refreshWeather() query.addQueryItem("q", d->city); query.addQueryItem("mode", "json"); + query.addQueryItem("APPID", d->app_ident); url.setQuery(query); QNetworkReply *rep = d->nam->get(QNetworkRequest(url)); @@ -443,6 +447,7 @@ void AppModel::handleWeatherNetworkData(QObject *replyObj) query.addQueryItem("q", d->city); query.addQueryItem("mode", "json"); query.addQueryItem("cnt", "5"); + query.addQueryItem("APPID", d->app_ident); url.setQuery(query); QNetworkReply *rep = d->nam->get(QNetworkRequest(url)); |