Qt中在图片上叠加显示文字
QCustLabel::QCustLabel(QWidget *parent):QLabel(parent)
{
{
setPixmap(QPixmap(QString::fromUtf8(":/images/square.png"))) ;
text="001";
}
void QCustLabel::paintEvent(QPaintEvent *event)
{
QLabel::paintEvent(event) ;
QPainter painter(this) ;
painter.drawText(QPoint(5,25),text);
return ;
}