#ifndef QMYROUNDINDICATOR_H #define QMYROUNDINDICATOR_H #include #include #include #include class QmyRoundIndicator : public QFrame { Q_OBJECT public: explicit QmyRoundIndicator(QWidget *parent = nullptr); void SetRange(int); void SetValue(float); void SetTarget(float); void SetTitle(QString title); void SetUnit(QString unit); void SetColor(QColor Start,QColor End); protected: void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE; int range=160; float target = 100; float position=0; float displayPosition = 0; int oldw=0; QColor color1 = QColor(120,180,255); QColor color2 = QColor(80,120,255); int nCount=0; QString sTitle=u8"产量"; QString sUnit=u8"只"; private slots: void OnTimerd(); signals: }; #endif // QMYROUNDINDICATOR_H