我想在运行时更改QFrame背景,但是,我会从磁盘加载背景(图像).在QFrame上设置样式表不起作用,因为图像不在资源中.
一种方法是设置QPushButton图标,例如:
QPixmap img("/images/01.png"); ui.pushButton->setIcon(QIcon(img));
但是,QPushButton对我没用.我需要把其他东西放在QFrame里面.
qt background image
background ×1
image ×1
qt ×1