newswidget.h 675 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef NEWSWIDGET_H
  2. #define NEWSWIDGET_H
  3. #include <QWidget>
  4. #include <QTimer>
  5. #include "networkdownloader.h"
  6. namespace Ui {
  7. class NewsWidget;
  8. }
  9. class LegacyApp;
  10. class NewsWidget : public QWidget
  11. {
  12. Q_OBJECT
  13. public:
  14. explicit NewsWidget(LegacyApp *_app, QWidget *parent = 0);
  15. ~NewsWidget();
  16. public slots:
  17. void updateNews();
  18. private:
  19. void constructNewsPiece(int piece_id, QString title, QString text, QString news_src);
  20. void setImgToNewsPiece(int piece_id, QPixmap img);
  21. private:
  22. Ui::NewsWidget *ui;
  23. LegacyApp *app;
  24. QTimer news_update_timer;
  25. QByteArray news_data;
  26. NetworkDownloader news_downloader;
  27. };
  28. #endif // NEWSWIDGET_H