26 lines
537 B
C++
26 lines
537 B
C++
#ifndef MYLABEL_H
|
|
#define MYLABEL_H
|
|
|
|
#include <QLabel>
|
|
|
|
class MyLabel : public QLabel
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
MyLabel(const QString& text, QWidget* parent = nullptr, QColor color = QColor(0xCC, 0xCC, 0xCC));
|
|
MyLabel(QWidget* parent = nullptr);
|
|
virtual ~MyLabel();
|
|
|
|
void setDeplayText(const QString& text) { m_text = text; QLabel::setText(text);}
|
|
void setFontColor(QColor color);
|
|
void setFontSize(int size);
|
|
|
|
protected:
|
|
void paintEvent(QPaintEvent *event);
|
|
|
|
private:
|
|
QString m_text;
|
|
};
|
|
|
|
#endif // MYLABEL_H
|