资源前缀为“/”(不含引号)。添加的图片名为“pic.png”.怎么
w.setStyleSheet("QDialog#background{border-image:url(:/pic.png)}");
或者
w.setAutoFillBackground(true);
QPalette palette;//同样可以设置背景图片
QPixmap as(":/pic.png");
palette.setBrush(QPalette::Background, QBrush(as));
w.setPalette(palette);
都用不了呢?