QLabel能否既设置背景色又加载图片?
labelList.at(i)->setStyleSheet("QLabel{background:rgb(234,71,6);color:white}"); // QPixmap pix(TODAY_SIGN_PATH); // labelList.at(i)->setPixmap(pix);labelList.at(i)->setStyleSheet("QLabel{background:rgb(234,71,6);" "color:white;" "image: url(:/Picture/abnormal);}");
[解决办法]
background-color: rgb(255, 0, 0);
image: url(:/images/test.jpg);
[解决办法]
写法应该是对的,看看图片是否有访问的权限。你确定使用setPixmap成功过吗?
[解决办法]
background-image: url(:/images/1.png);background-color: rgb(255, 170, 255);