pyqt5窗口隐藏与显示的技巧代码

    def keyPressEvent(self, event):
        curKey = event.key()
        print("按下:" + str(event.key()))
        if curKey == Qt.Key_F3:
            self.switch_navigate_window_state(True)
        elif curKey == Qt.Key_Return:
            self.on_pb_query_clicked()

    def switch_navigate_window_state(self, show_flag):
        if show_flag:
            self.navigate.show()
            self.navigate.activateWindow()
        else:
            self.navigate.hide()

Author: bkdwei