当前位置:网站首页>Pyqt5 setting window top left Icon

Pyqt5 setting window top left Icon

2022-06-23 06:05:00 cjh_ hit

Want to change the icon in the upper left corner of the window , You can refer to the following methods :

Give the code directly :

icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap(" Icon .ico"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
MainWindow.setWindowIcon(icon)

notes : Icon .ico Is the address of the icon resource
That is, the statement selected below :
 Insert picture description here

原网站

版权声明
本文为[cjh_ hit]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/174/202206230423074716.html