def __call__(self, *args, **kwargs):
if constant.MAIN_UI is None:
raise RuntimeError('Main UI not initialized')
# Check if this was called in the main thread (the one running Qt EventLoop)
# noinspection PyProtectedMember
if isinstance(threading.current_thread(), threading._MainThread):
# If we are in the EventLoop, there's no need to dispatch the call to the a signal
# noinspection PyProtectedMember
constant.MAIN_UI._do('main_ui', self.func.__name__, args, kwargs)
else:
# Otherwise, queue the call
constant.MAIN_UI.do('main_ui', self.func.__name__, *args, **kwargs)
# noinspection PyAbstractClass
评论列表
文章目录