码迷,mamicode.com
首页 > 其他好文 > 详细

Qt 一张图片显示在其他组件之上

时间:2019-10-22 15:25:12      阅读:126      评论:0      收藏:0      [点我收藏+]

标签:scale   str   set   ntb   idt   led   new   attr   label   

图片放在QLabel上,注意设置QLable一些属性

QImage img("test.png");
img = img.scaledToWidth(400,Qt::SmoothTransformation);
QLabel* label = new QLabel(this, Qt::FramelessWindowHint|Qt::Tool);
label->setPixmap(QPixmal::fromImage(img));
label->setGeomtry(0,0,400,300);
label->setAttribute(Qt::WA_TranslucentBackground);
label->show();

 

Qt 一张图片显示在其他组件之上

标签:scale   str   set   ntb   idt   led   new   attr   label   

原文地址:https://www.cnblogs.com/coolbear/p/11719535.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!