PYQT5系统托盘双击显示隐藏主界面

        self.system_tray.show()#显示系统托盘
        self.system_tray.activated[QSystemTrayIcon.ActivationReason].connect(self.iconActivated)

    def iconActivated(self,reason):
        if reason == QSystemTrayIcon.DoubleClick:
            if self.isHidden():
                self.show()
            else:
                self.hide()

你可能感兴趣的:(pyqt5)