This repository has been archived on 2026-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
Simon Stürz 8a4f06f47f added openweathermap plugin
removed weatherground and meisteranker plugin from code...they need later some more time
2014-04-06 22:27:56 +02:00

61 lines
1.2 KiB
C++

#ifndef OPENWEATHERMAP_H
#define OPENWEATHERMAP_H
#include <QObject>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QJsonDocument>
#include <QUrl>
class OpenWeatherMap : public QObject
{
Q_OBJECT
public:
explicit OpenWeatherMap(QObject *parent = 0);
private:
QNetworkAccessManager *m_manager;
QString m_cityName;
QString m_cityId;
QNetworkReply *m_locationReplay;
QNetworkReply *m_searchReplay;
QNetworkReply *m_weatherReplay;
QString m_country;
QString m_weatherDescription;
uint m_lastUpdate;
uint m_sunrise;
uint m_sunset;
double m_temperatur;
double m_temperaturMin;
double m_temperaturMax;
double m_pressure;
double m_windSpeed;
int m_windDirection;
int m_humidity;
int m_cloudiness;
void updateLocationData();
void updateSearchData();
void updateWeatherData();
void processLocationResponse(QByteArray data);
void processSearchResponse(QByteArray data);
void processWeatherResponse(QByteArray data);
signals:
public slots:
void update();
private slots:
void replyFinished(QNetworkReply *reply);
};
#endif // OPENWEATHERMAP_H