Qt 一張圖片顯示在其餘組件之上

圖片放在QLabel上,注意設置QLable一些屬性less

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();
相關文章
相關標籤/搜索