#ifndef WEATHERWIDGET_H #define WEATHERWIDGET_H #include "Glass_global.h" #include #include #include #include #include #include #include #include #include #include #include class GLASSSHARED_EXPORT WeatherWidget : public QWidget { Q_OBJECT public: WeatherWidget(QWidget *parent = 0); ~WeatherWidget(); void setWeatherAlignment(Qt::Alignment weatherAlignment); Qt::Alignment weatherAlignment(); private: enum WeatherImage { Clear, ClearNight, Cloud, CloudNight, Rain, Storm, }; struct BlendStatus { int amount; float duration; WeatherImage background; WeatherImage foreground; BlendStatus() { duration = 0.f; background = Clear; foreground = Clear; } }; void getAmountPixmap(const int amount, QPixmap &pixmap); QImage *imageFromWeather(WeatherImage type); QList _areaNames; QList _nameLabels; QList _imageLabels; QList _blendStatus; QGridLayout *glMainLayout; QBasicTimer tmBlendTimer; QBasicTimer tmWeatherTimer; QPixmapCache pcWeatherAmount; QImage *_clear; QImage *_clearNight; QImage *_cloud; QImage *_cloudNight; QImage *_rain; QImage *_storm; QFont _amountFont; QFontMetrics *_amountFM; Qt::Alignment pWeatherAlignment; protected: void timerEvent(QTimerEvent *event); }; #endif // WEATHERWIDGET_H