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

25 lines
522 B
C++

#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; }
protected:
virtual void paintEvent(QPaintEvent *);
private:
QString m_text;
QColor m_backgroundColor;
};
#endif // CIRCLELABEL_H