qt/LedOK/player/elemultipng.h

40 lines
970 B
C
Raw Normal View History

2023-04-18 14:14:46 +08:00
#ifndef ELEMULTIPNG_H
#define ELEMULTIPNG_H
2023-10-23 14:58:29 +08:00
#include "gutil/qjson.h"
2023-04-18 14:14:46 +08:00
#include <QWidget>
#include <QRandomGenerator>
2023-10-23 14:58:29 +08:00
2023-04-18 14:14:46 +08:00
class EleSplitPng;
class EleMultiPng : public QWidget {
Q_OBJECT
public:
2023-10-23 14:58:29 +08:00
explicit EleMultiPng(QString, const JValue &, QWidget *parent);
2023-04-18 14:14:46 +08:00
void startMove();
QVector<QPixmap> imgs;
int timerId = 0, moveTimerId = 0;
int picDur = 0, EffDur = 0, moveInter = 0, movePx = 0, imgc = 0, imgx = 0, imgy = 0;
2023-04-19 14:42:06 +08:00
QChar effType{0};
2023-04-18 14:14:46 +08:00
QRandomGenerator rand;
bool needRand = false;
QList<EleSplitPng*> splits;
protected:
void paintEvent(QPaintEvent *) override;
void timerEvent(QTimerEvent *) override;
};
class EleSplitPng : public QWidget {
Q_OBJECT
public:
explicit EleSplitPng(EleMultiPng *multiPng, QWidget *parent) : QWidget{parent}, multiPng(multiPng) {}
protected:
void paintEvent(QPaintEvent *) override;
EleMultiPng *multiPng;
};
#endif // ELEMULTIPNG_H