qt/LedOK/program/etimer.h

38 lines
792 B
C
Raw Permalink Normal View History

2022-08-25 18:37:24 +08:00
#ifndef ETIMER_H
#define ETIMER_H
#include <QTimer>
#include <QColor>
#include <QFont>
#include <QDateTime>
#include "ebase.h"
class ETimer : public EBase {
Q_OBJECT
public:
explicit ETimer(EBase *multiWin = nullptr);
2023-10-23 14:58:29 +08:00
explicit ETimer(const JObj &json, EBase *multiWin = nullptr);
2022-08-25 18:37:24 +08:00
2024-08-07 18:18:37 +08:00
void init();
2022-08-25 18:37:24 +08:00
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
int type() const override { return EBase::Timer; }
QWidget* attrWgt() override;
2023-10-23 14:58:29 +08:00
JObj attrJson() const override;
2022-08-25 18:37:24 +08:00
int secs = 0;
2024-08-07 18:18:37 +08:00
QDateTime targetTime;
QFont font;
QString text;
QColor textColor;
QColor backColor;
bool isDown;
bool isMultiline;
bool hasDay;
bool hasHour;
bool hasMin;
bool hasSec;
2022-08-25 18:37:24 +08:00
};
#endif // ETIMER_H