0
这个问题可能会重复,但我没有得到回答我的问题 我正在使用python 2.7 无法设置使用python Qframe的背景图像以下代码在centos中正常工作,但在窗口7甚至没有显示任何错误,无法设置使用python Qframe的背景图像
self.frame_2.setStyleSheet(_fromUtf8("border:0px;background-image:
url("+self.getImagePath("4.jpg")+")"))
def getImagePath(self,image):
pluginPath = (os.path.dirname(__file__))
themePath = str("icons") + QDir.separator() + str(image)
filePath = pluginPath + QDir.separator() + themePath
if QFile.exists(pluginPath + QDir.separator() + themePath):
return filePath
else:
return ""
我已经试过但它不适用于我 –
我的代码对于centos很好,但它不适用于windows。 –
我编辑了我的答案 –