#ifndef CIRCLELABEL_H #define CIRCLELABEL_H #include #include #include class CircleLable : public QLabel { Q_OBJECT public: CircleLable(const QString& text, QWidget* parent = nullptr, int size = 24, QColor backgroundColor = QColor(0xCC, 0xCC, 0xCC)); virtual ~CircleLable(); void setText(const QString& text) { m_text = text; } void setBackgroundColor(QColor backgroundColor); protected: virtual void paintEvent(QPaintEvent *); private: QString m_text; QColor m_backgroundColor; }; #endif // CIRCLELABEL_H