标签:nbsp ges 编程 return qpixmap ima app 显示 取图
、
#include "QT_Text1.h"
#include <QtWidgets/QApplication>
#include <QBitmap>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QT_Text1 w;
QPixmap pixmap("images/timg2.jpg"); // 读取图片
QPalette palette;
palette.setBrush(w.backgroundRole(), QBrush(pixmap)); // 将图片设置在指定窗口
w.setPalette(palette);
w.setMask(pixmap.mask()); //可以将图片中透明部分显示为透明的
w.setAutoFillBackground(true); // 自动充满
w.show();
return a.exec();
}
图片的存取位置 images/timg2


标签:nbsp ges 编程 return qpixmap ima app 显示 取图
原文地址:http://www.cnblogs.com/dongvdong/p/7475554.html