qt/LedOK/player/elescroll.h
2023-10-23 14:58:29 +08:00

34 lines
887 B
C++

#ifndef ELESCROLL_H
#define ELESCROLL_H
#include "gutil/qjson.h"
#include <QWidget>
class EleSplitScroll;
class EleScroll : public QWidget {
Q_OBJECT
public:
explicit EleScroll(QWidget *, QString, const JValue &);
explicit EleScroll(QWidget *, QString, char effect = 0, double effDur = 0.0);
QPixmap img;
char effect = 0;
int interval = 0, timerId = 0, cur = 0, end = 0, step = 1;
std::vector<EleSplitScroll*> splits;
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