pyqt设置程序左上角图标(图片来源网上)

def setLogo(self):
try:
if ~(os.path.exists("C:\\Logo.ico")):
url = "https://gitee.com/xdd1997/Download-or-Picture/raw/master/Logo.ico"
filepath = "C:\\Logo.ico"
urllib.request.urlretrieve(url, filepath)
self.setWindowIcon(QIcon('C:\\Logo.ico'))
except:
print("设置图标失败")

 

上一篇:Pro Android4 面试题归纳


下一篇:可拖动pyqt