这个问题可能会重复,但我的问题得不到答案 我使用的是python2.7 无法使用python设置Qframe的背景图像,下面的代码在centos中可以正常工作,但是在windows7中甚至没有显示任何错误
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 ""
这段代码在windows上运行。在
相关问题 更多 >
编程相关推荐