1#ifndef MYWEATHERREQUEST_H
2#define MYWEATHERREQUEST_H
4#include <QNetworkAccessManager>
5#include <QtClassHelperMacros>
80 static constexpr const char*
private_key = _DEF_WEATHER_PRIVATE_KEY;
100 void onReplyFinished(QNetworkReply* reply);
The WeatherRequest class provides the interface to request weather data.
Definition MyWeatherRequest.h:47
void result_available(const QString json)
Emitted when the result is available.
virtual QUrlQuery compose_request()=0
Composes the request parameters.
QNetworkAccessManager manager
The network manager handling requests.
Definition MyWeatherRequest.h:75
Q_DISABLE_COPY(WeatherRequest)
Disables copy constructor and copy assignment. This prevents copying of the WeatherRequest object.
void async_request(const char *base_url)
Sends the request asynchronously.
Definition MyWeatherRequest.cpp:11
static constexpr const char * private_key
Private key for accessing the weather service.
Definition MyWeatherRequest.h:80
void errorOccurs(QNetworkReply *reply)
Emitted when an error occurs in the request.
The WeatherResult class provides the weather result interfaces.
Definition MyWeatherRequest.h:13
WeatherResult(QObject *obj=nullptr)
Constructor for WeatherResult.
Definition MyWeatherRequest.h:20
virtual void parseJsonString(const QString json)=0
Parses the JSON string.
void error_occurs(QString cached_error_string)
Emitted when an error occurs.
void finish_parse()
Emitted when the parsing is finished.