add switch bridge
This commit is contained in:
@@ -25,7 +25,7 @@ void DoricSwitchNode::blend(QQuickItem *view, QString name, QJsonValue prop) {
|
||||
view->setProperty("checked", prop.toBool());
|
||||
checkByCodeToggle = false;
|
||||
} else if (name == "onSwitch") {
|
||||
|
||||
onSwitchFuncId = prop.toString();
|
||||
} else if (name == "offTintColor") {
|
||||
view->setProperty(
|
||||
"offTintColor",
|
||||
@@ -41,3 +41,13 @@ void DoricSwitchNode::blend(QQuickItem *view, QString name, QJsonValue prop) {
|
||||
DoricViewNode::blend(view, name, prop);
|
||||
}
|
||||
}
|
||||
|
||||
void DoricSwitchNode::onSwitch(bool checked) {
|
||||
if (checkByCodeToggle)
|
||||
return;
|
||||
if (!onSwitchFuncId.isEmpty()) {
|
||||
QVariantList args;
|
||||
args.append(checked);
|
||||
callJSResponse(onSwitchFuncId, args);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user