Files
work-secretfile-selfcheck/UmiOCR-data/qt_res/qml/EventBus/PubSub.qml

26 lines
740 B
QML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// ====================================================
// =============== 全局事件 发布/订阅机制 ===============
// ====================================================
import PubSubConnector 1.0
PubSubConnector{
// 订阅事件。传入 标题函数所在Item函数名
// subscribe(title, item, funcName)
// 订阅事件,可额外传入组
// subscribeGroup(title, item, funcName, groupName)
// 取消订阅事件
// unsubscribe(title, item, funcName)
// 取消订阅整组事件
// unsubscribeGroup(groupName)
// 发布事件,传入任意参数
function publish(title, ...args) {
console.log("qml 发布事件", title, args)
publish_(title, args)
}
}