diff options
author | Ivan Solovev <ivan.solovev@qt.io> | 2021-08-18 11:13:55 +0200 |
---|---|---|
committer | Ivan Solovev <ivan.solovev@qt.io> | 2021-08-24 09:44:16 +0200 |
commit | aa773a4a2c7253e39796b3b9068fb7269254d2e8 (patch) | |
tree | d9ce41663e72757fb0f167980192d20982384d66 | |
parent | 6458b9b60a016bbe0ad6574a1965c49dcd9383f3 (diff) | |
download | qtlocation-aa773a4a2c7253e39796b3b9068fb7269254d2e8.tar.gz |
Weatherinfo: update documentation
Mention multiple data providers and the related limitations.
As a drive-by: update the example image, because the previous one was
showing the temperature in Fahrenheit, while the application currently
uses Celsius.
Task-number: QTBUG-60467
Pick-to: 6.2
Change-Id: I47f3c118a47e840ff048bfa273b80c0b13a50808
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
-rw-r--r-- | examples/positioning/weatherinfo/doc/images/example-weatherinfo.png | bin | 82081 -> 70264 bytes | |||
-rw-r--r-- | examples/positioning/weatherinfo/doc/src/weatherinfo.qdoc | 32 |
2 files changed, 25 insertions, 7 deletions
diff --git a/examples/positioning/weatherinfo/doc/images/example-weatherinfo.png b/examples/positioning/weatherinfo/doc/images/example-weatherinfo.png Binary files differindex 6557b57b..3a1c6c24 100644 --- a/examples/positioning/weatherinfo/doc/images/example-weatherinfo.png +++ b/examples/positioning/weatherinfo/doc/images/example-weatherinfo.png diff --git a/examples/positioning/weatherinfo/doc/src/weatherinfo.qdoc b/examples/positioning/weatherinfo/doc/src/weatherinfo.qdoc index 12f0387e..7d9cab6f 100644 --- a/examples/positioning/weatherinfo/doc/src/weatherinfo.qdoc +++ b/examples/positioning/weatherinfo/doc/src/weatherinfo.qdoc @@ -45,9 +45,27 @@ \include examples-run.qdocinc - \section1 Application Data Models + \section1 Weather Data Providers + + The example uses two unrelated weather data providers: + + \list + \li \l {http://www.openweathermap.org}{OpenWeather} + \li \l {https://www.weatherapi.com/}{WeatherAPI.com} + \endlist + + The provider to be used is selected automatically at runtime and can be + changed if the selected provider is not available. However, it can't be + specified manually. - The example uses weather data provided by \l http://www.openweathermap.org. + \note Free plans are used for both providers, which implies certain + limitations on the amount of weather requests. If the limits are exceeded, + the providers become temporary unavailable. When both providers are + unavailable, the application would not be able to show any weather + information. In this case it is required to wait until at least one of the + providers becomes available again. + + \section1 Application Data Models The key part of this example is the application's data model, contained in the \c WeatherData and \c AppModel classes. \c WeatherData represents @@ -60,7 +78,7 @@ \c AppModel models the state of the entire application. At startup, we get the platform's default position source using - \l QGeoPositionInfoSource::createDefaultSource() + \l QGeoPositionInfoSource::createDefaultSource(). \snippet weatherinfo/appmodel.cpp 0 \snippet weatherinfo/appmodel.cpp 1 @@ -72,8 +90,8 @@ begins regular updates of device position. When a position update is received, we use the longitude and latitude - of the returned coordinate to retrieve the current "city" name for use - in the weather lookup. + of the returned coordinate to retrieve weather data for the specified + location. \snippet weatherinfo/appmodel.cpp 2 @@ -88,8 +106,8 @@ \snippet weatherinfo/appmodel.h 4 We use a \l QQmlListProperty for the weather forecast information, - which contains the next 4 days of forecast weather. This makes it - easy to access from QML. + which contains the weather forecast for the next days (the number of days + is provider-specific). This makes it easy to access the forecast from QML. \section1 Expose Custom Models to QML |