add shared ptr wrap for async result

This commit is contained in:
王劲鹏
2021-05-12 11:08:40 +08:00
committed by osborn
parent 3531a28f13
commit 33bec666a4
7 changed files with 54 additions and 33 deletions

View File

@@ -208,7 +208,8 @@ QList<QString> DoricViewNode::getIdList() {
void DoricViewNode::requestLayout() {}
void DoricViewNode::callJSResponse(QString funcId, QVariantList args) {
std::shared_ptr<DoricAsyncResult>
DoricViewNode::callJSResponse(QString funcId, QVariantList args) {
QVariantList nArgs;
QList<QString> idList = getIdList();
nArgs.append(QVariant(idList));
@@ -219,7 +220,8 @@ void DoricViewNode::callJSResponse(QString funcId, QVariantList args) {
return getContext()->callEntity(DoricConstant::DORIC_ENTITY_RESPONSE, nArgs);
}
void DoricViewNode::pureCallJSResponse(QString funcId, QVariantList args) {
std::shared_ptr<DoricAsyncResult>
DoricViewNode::pureCallJSResponse(QString funcId, QVariantList args) {
QVariantList nArgs;
nArgs.append(getContext()->getContextId());
nArgs.append(DoricConstant::DORIC_ENTITY_RESPONSE);

View File

@@ -77,8 +77,10 @@ public:
void onClick();
void callJSResponse(QString funcId, QVariantList args);
std::shared_ptr<DoricAsyncResult> callJSResponse(QString funcId,
QVariantList args);
void pureCallJSResponse(QString funcId, QVariantList args);
std::shared_ptr<DoricAsyncResult> pureCallJSResponse(QString funcId,
QVariantList args);
};
#endif // DORICVIEWNODE_H