28 lines
686 B
C++
28 lines
686 B
C++
#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
|