qt/LedOK/player/eleanaclock.h

28 lines
686 B
C
Raw Normal View History

2023-04-18 14:14:46 +08:00
#ifndef ELEANACLOCK_H
#define ELEANACLOCK_H
#include <QWidget>
#include <QTimeZone>
#include <QPen>
class EleAnaClock : public QWidget {
Q_OBJECT
public:
explicit EleAnaClock(double w, double h, QString path, const QJsonObject &layer, QWidget *parent = nullptr);
void cal();
QTimeZone timeZone;
QPixmap img;
QColor pinHourColor, pinMinColor, pinSecColor;
QPointF hPoses[3]{}, mPoses[3]{}, sPoses[3]{};
double hAngle, mAngle, sAngle;
QPen pen;
int timerId{0};
bool showSecHand{true};
protected:
void paintEvent(QPaintEvent *) override;
void timerEvent(QTimerEvent *) override;
};
#endif // ELEANACLOCK_H