Display image in Qt to fit label size

前端 未结 7 1197
[愿得一人]
[愿得一人] 2021-02-01 02:53

I already tried several methods on displaying an image on a form, but none of them works how I would like.

I\'ve read many places that the easiest way is to create a la

7条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-01 03:41

    QPixmap pic = QPixmap(":/resource/xxx.png").scaled(16,16,Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
    
    ui->yourLable->setPixmap(pic);
    

提交回复
热议问题