QT4如何给QMainWindow增加背景图片啊!!!!!!!!!
main
int main(int argc, char *argv[]){ QApplication a(argc, argv); //设置编码,显示中文 QTextCodec::setCodecForTr( QTextCodec::codecForName("GB2312") ); COrderComm oOdCm; oOdCm.showMaximized(); return a.exec();}
COrderComm::COrderComm(QWidget *parent) : QMainWindow(parent) { //这里如何加在背景图片啊 }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow){ ui->setupUi(this); QPalette palette; palette.setBrush(QPalette::Background, QBrush(QPixmap("1.jpg"))); this->setPalette(palette);}