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("设置图标失败")
本文来自博客园,作者:xdd1997
转载请注明:https://www.cnblogs.com/xdd1997/p/14803271.html