The WeatherRequest class provides the interface to request weather data.
More...
#include <MyWeatherRequest.h>
|
void | errorOccurs (QNetworkReply *reply) |
| Emitted when an error occurs in the request.
|
|
void | result_available (const QString json) |
| Emitted when the result is available.
|
|
|
QNetworkAccessManager | manager |
| The network manager handling requests.
|
|
|
static constexpr const char * | private_key = _DEF_WEATHER_PRIVATE_KEY |
| Private key for accessing the weather service.
|
|
The WeatherRequest class provides the interface to request weather data.
This class manages the HTTP requests and handles the returned JSON.
◆ WeatherRequest()
WeatherRequest::WeatherRequest |
( |
QObject * |
parent = nullptr | ) |
|
|
explicit |
◆ async_request()
void WeatherRequest::async_request |
( |
const char * |
base_url | ) |
|
Sends the request asynchronously.
- Parameters
-
base_url | The base URL without any request parameters. |
◆ compose_request()
virtual QUrlQuery WeatherRequest::compose_request |
( |
| ) |
|
|
pure virtual |
Composes the request parameters.
- Returns
- The composed request query.
Implemented in AppWeatherRequest.
◆ errorOccurs
void WeatherRequest::errorOccurs |
( |
QNetworkReply * |
reply | ) |
|
|
signal |
Emitted when an error occurs in the request.
- Parameters
-
reply | The reply object that caused the error. |
◆ result_available
void WeatherRequest::result_available |
( |
const QString |
json | ) |
|
|
signal |
Emitted when the result is available.
- Parameters
-
json | The JSON string returned from the request. |
The documentation for this class was generated from the following files:
- extern_app/WeatherApp/Core/MyWeatherRequest.h
- extern_app/WeatherApp/Core/MyWeatherRequest.cpp