class MyApp(QApplication): instance = None @staticmethod def getInstance(): if MyApp.instance is None: MyApp.instance = MyApp(sys.argv) return MyApp.instance class WindowManager(QObject): def __init__(self): super().__init__() self.currentWindow = None @Slot(str) def handleRequest(self, requestType, app, **kwargs): if requestType == "idcard": self.currentWindow = IdCardView() elif requestType == "keypad": self.currentWindow = KeyPadView(kwargs.get("flag")) elif requestType == "financeIcCard": self.currentWindow = FinanceIcCardView() elif requestType == "mockMagnetIC": self.currentWindow = MagneticView() self.currentWindow.ui.show() app.exec() return self.currentWindow.getData() def run_app(windowType, **kwargs): app = MyApp.getInstance() windowManager = WindowManager() return windowManager.handleRequest(windowType, app, flag=kwargs.get("flag")) 想通过run()方法传入不同的参数,根据参数调用对应的窗口且返回数据,但是这里会阻塞,请问这个可以怎么改造