Skip to content

Commit

Permalink
优化/注释
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroi-sora committed May 12, 2024
1 parent c462ebd commit 342b0ca
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions UmiOCR-data/py_src/imports/call_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,21 @@
# =============== 为插件提供接口,在主线程中调用指定函数 ===============
# ==================================================================

"""
from call_func import CallFunc
def func():
print("延时3秒调用!")
id = CallFunc.delay(func, 3) # 延时调用
# CallFunc.delayStop(id) # 取消延时调用
"""

from PySide2.QtCore import QObject, Slot, Signal, QTimer, QMutex
from uuid import uuid4 # 唯一ID


class __CallFunc(QObject):
class _CallFunc(QObject):
def __init__(self):
super().__init__()
# 信号 在主线程中调用函数
Expand Down Expand Up @@ -62,4 +72,4 @@ class cSignal(QObject):
signal = Signal("QVariant")


CallFunc = __CallFunc()
CallFunc = _CallFunc()

0 comments on commit 342b0ca

Please sign in to comment.