设置背景图片不生效
大家好,我在继承qwidget的一个类中设置背景图片用下面代码,但是总是不出现该背景图,各位知道我那里弄错了吗?
QPixmap bgImages(":/Icon/home_chuntian.png");
bgImages.load("res/Icon/home_chuntian.png");
QPalette bgPalette = this->palette();
bgPalette.setBrush(QPalette::Background,bgImages);
this->setPalette(bgPalette);
this->show();