PYQT5 窗口图标设置为何任务栏没有变化, 试过很多方法, 请大神指点什么原因。
class Window(QMainWindow):
def __init__(self):
super().__init__()
self.setWindowFlag(QtCore.Qt.FramelessWindowHint) # 隐藏边框
self.setWindowTitle('Kapok') # APP名称
icon_path = os.path.join(os.path.dirname(__file__),
'./Icon_file/Icon_file/KAPOK.ico')
icon = QIcon()
icon.addPixmap(QPixmap(icon_path)) # 图标logo。
self.setWindowIcon(icon)