def on_systemTrayIcon_activated(self, reason): if reason == QtWidgets.QSystemTrayIcon.DoubleClick: self.parent.toggle_visibility()