pyQt怎样设置窗口标题、图标

1、设置窗口标题

使用函数:setWindowTitle

self.setWindowTitle("设置窗口名称")   # 设置窗口名

2、设置窗口图标

使用函数:setWindowIcon

因需要使用到QIcon()方法,需要:from PyQt5.QtGui import QIcon

self.setWindowIcon(QtGui.QIcon("./img/sys-user.png")) 

示例:
pyQt怎样设置窗口标题、图标_第1张图片

你可能感兴趣的:(PyQt5,python,qt,qt5)