summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Solovev <ivan.solovev@qt.io>2021-08-18 11:13:55 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-08-24 10:54:21 +0000
commitc21a2d2062db154a2039dbccdbd6ada447cda103 (patch)
tree2a6be190990d18516b28732d50a5f0013050cad8
parent45f93ced23d73de945e6350c7964bcc17d3f6e3d (diff)
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 Change-Id: I47f3c118a47e840ff048bfa273b80c0b13a50808 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit aa773a4a2c7253e39796b3b9068fb7269254d2e8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--examples/positioning/weatherinfo/doc/images/example-weatherinfo.pngbin82081 -> 70264 bytes
-rw-r--r--examples/positioning/weatherinfo/doc/src/weatherinfo.qdoc32
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
index 6557b57b..3a1c6c24 100644
--- a/examples/positioning/weatherinfo/doc/images/example-weatherinfo.png
+++ b/examples/positioning/weatherinfo/doc/images/example-weatherinfo.png
Binary files differ
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