qt/LedOK/player/playwin.h
2022-01-20 10:08:17 +08:00

46 lines
1018 B
C++

#ifndef PLAYWIN_H
#define PLAYWIN_H
#include "elebase.h"
#include "ttimer.h"
#include <QWidget>
#include <QVector>
#include <QMap>
class Page : public QWidget {
public:
explicit Page(QWidget *parent = nullptr);
QString name;
QString dirPre;
int timeSpan = 0;
QVector<EleBase> eles;
};
class TimerValue{
public:
TimerValue(QWidget *ele = nullptr, bool visible = false): ele(ele), visible(visible){}
QWidget* ele;
bool visible;
};
class PlayWin : public QWidget{
Q_OBJECT
public:
SyncTimer* timer = nullptr;
int cur = 0;
QMap<int,TimerValue> timerMap;
PlayWin(QString dir, int x, int y, int width, int height, const QJsonObject &prog, QWidget *parent = nullptr);
public slots:
void sltNext();
void sltSetVisible(QWidget *wgt, bool visible){
wgt->setVisible(visible);
}
signals:
void sigSetVisible(QWidget *, bool);
protected:
void paintEvent(QPaintEvent *) override;
void timerEvent(QTimerEvent *) override;
};
#endif // PLAYWIN_H