Qt creator添加背景图片不成功
我用setStylesheet想要把某个图片当做背景Dialog::Dialog(QWidget*parent):QDialog(parent),ui(newUi::Di...
我用setStylesheet 想要把某个图片当做背景
Dialog::Dialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::Dialog)
{
ui->setupUi(this);
this->resize(1000,600);
this->setStyleSheet("background-image:url(G:\QtWorkspace\Stickman\background2.png)");
this->update();
}
程序可以运行,但背景总是空的说“Could not parse stylesheet of object 0x57db40fb10“
求如何解决! 展开
Dialog::Dialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::Dialog)
{
ui->setupUi(this);
this->resize(1000,600);
this->setStyleSheet("background-image:url(G:\QtWorkspace\Stickman\background2.png)");
this->update();
}
程序可以运行,但背景总是空的说“Could not parse stylesheet of object 0x57db40fb10“
求如何解决! 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询