发布网友
共1个回答
热心网友
一,
添加窗体背景
在窗体构造函数中加入:方法1:
this-setStyleSheet(tr("background:url(pic.jpg)"));方法二:
this-setAutoFillBackground(true);
QPalette
myPalette;
myPalette.setBrush(this-backgroundRole(),
QBrush(QPixmap("./pic.jpg")));
this-setPalette(myPalette);
二,改变背景颜色在窗体构造函数中加入: