03 控件 QLabel
QLabel类
QLabel用于显示文本、图像、动画,但不提供用户交互功能
继承关系:QLabel <- QFrame <- QWidget
1.常用API
方法 | 描述 |
---|---|
void setText(const QString &text) | 设置显示文本 |
void setAlignment(Qt::Alignment) | 设置文本显示位置 |
void setFont(const QFont &) | 设置字体 |
void setPixmap(const QPixmap &) | 设置图片 |
void setMovie(QMovie *movie) | 设置动图 |
void setNum(double num) | 设置数字 |
void clear() | 清空 |
2.显示图片
1 | //1. 设置标签 |
3.显示动图
1 | //显示动图 |
All articles on this blog are licensed under CC BY-NC-SA 4.0 unless otherwise stated.