qt/LedOK/player/elescroll.h

34 lines
887 B
C
Raw Normal View History

2023-04-18 14:14:46 +08:00
#ifndef ELESCROLL_H
#define ELESCROLL_H
2023-10-23 14:58:29 +08:00
#include "gutil/qjson.h"
2023-04-18 14:14:46 +08:00
#include <QWidget>
2023-10-23 14:58:29 +08:00
2023-04-18 14:14:46 +08:00
class EleSplitScroll;
class EleScroll : public QWidget {
Q_OBJECT
public:
2023-10-23 14:58:29 +08:00
explicit EleScroll(QWidget *, QString, const JValue &);
2023-04-18 14:14:46 +08:00
explicit EleScroll(QWidget *, QString, char effect = 0, double effDur = 0.0);
QPixmap img;
char effect = 0;
2023-10-23 14:58:29 +08:00
int interval = 0, timerId = 0, cur = 0, end = 0, step = 1;
std::vector<EleSplitScroll*> splits;
2023-04-18 14:14:46 +08:00
void paint(QPaintDevice *);
protected:
void paintEvent(QPaintEvent *) override;
void timerEvent(QTimerEvent *) override;
};
class EleSplitScroll : public QWidget {
Q_OBJECT
public:
explicit EleSplitScroll(QWidget *parent, EleScroll *scroll) : QWidget{parent}, scroll(scroll) {};
protected:
void paintEvent(QPaintEvent *) override;
EleScroll *scroll;
};
#endif // ELESCROLL_H