QPalette。
步骤:
1、定义一个QPalette对象
2、设置QPalette对象的背景属性(颜色或图片)
3、设置 autoFillBackground属性为真
4、最后设置QWidget对象的Palette
QPixmap pixmap("F://Qt//draw//44.jpg");
QPalette palette1;
palette1.setBrush(QPalette::Background,QBrush(pixmap));
this->setPalette(palette1);
this->setAutoFillBackground(true);