yhkylin-backup-tools/kybackup/component/circlelabel.h

26 lines
575 B
C
Raw Normal View History

2021-10-13 16:31:58 +08:00
#ifndef CIRCLELABEL_H
#define CIRCLELABEL_H
#include <QLabel>
#include <QPaintEvent>
#include <QColor>
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; }
2021-10-26 09:24:05 +08:00
void setBackgroundColor(QColor backgroundColor);
2021-10-13 16:31:58 +08:00
protected:
virtual void paintEvent(QPaintEvent *);
private:
QString m_text;
QColor m_backgroundColor;
};
#endif // CIRCLELABEL_H