CCIMXDesktop
 
Loading...
Searching...
No Matches
WeatherChartWidget.h
1#ifndef WEATHERCHARTWIDGET_H
2#define WEATHERCHARTWIDGET_H
3
4#include "AppWeatherRequest.h"
5#include <QWidget>
6#include <QtCharts>
7namespace Ui {
9}
10
16class WeatherChartWidget : public QWidget {
17 Q_OBJECT
18
19public:
37 explicit WeatherChartWidget(QWidget* parent = nullptr);
38
44 void fresh_display(QList<AppWeatherResult::DailyWeather>& weathers);
45
51 void switch_to_page(const Page& p);
53
54private:
55 using FromDailySession = std::function<int(const AppWeatherResult::DailyWeather&)>;
56 void makeup_chart(
57 const QList<AppWeatherResult::DailyWeather>& data,
58 const QString& title,
59 FromDailySession sessionfunc);
60 void makeup_mainpage(const QList<AppWeatherResult::DailyWeather>& data);
61 Ui::WeatherChartWidget* ui;
62};
63
64#endif // WEATHERCHARTWIDGET_H
The WeatherChartWidget class provides the weather chart widget.
Definition WeatherChartWidget.h:16
void switch_to_page(const Page &p)
switch_to_page
Definition WeatherChartWidget.cpp:31
void fresh_display(QList< AppWeatherResult::DailyWeather > &weathers)
fresh_display
Definition WeatherChartWidget.cpp:16
Page
The Page enum The Page enum provides the page index.
Definition WeatherChartWidget.h:25
@ HIGH_TEMP
high temperature page
Definition WeatherChartWidget.h:27
@ MAIN_PAGE
main page
Definition WeatherChartWidget.h:26
@ LOW_TEMP
low temperature page
Definition WeatherChartWidget.h:28
@ WINDSCALE
wind scale page
Definition WeatherChartWidget.h:29
@ HUMIDITY
humidity page
Definition WeatherChartWidget.h:30
The DailyWeather struct provides the daily weather details. The JSON strings are expected to serializ...
Definition AppWeatherRequest.h:33