QtAwesomeAnim.h 622 B

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef QTAWESOMEANIMATION_H
  2. #define QTAWESOMEANIMATION_H
  3. #include <QObject>
  4. class QPainter;
  5. class QRect;
  6. class QTimer;
  7. class QWidget;
  8. ///
  9. /// Basic Animation Support for QtAwesome (Inspired by https://github.com/spyder-ide/qtawesome)
  10. ///
  11. class QtAwesomeAnimation : public QObject
  12. {
  13. Q_OBJECT
  14. public:
  15. QtAwesomeAnimation( QWidget* parentWidget, int interval=10, int step=1);
  16. void setup( QPainter& painter, const QRect& rect );
  17. public slots:
  18. void update();
  19. private:
  20. QWidget* parentWidgetRef_;
  21. QTimer* timer_;
  22. int interval_;
  23. int step_;
  24. float angle_;
  25. };
  26. #endif // QTAWESOMEANIMATION_H