diff options
author | Andrei Golubev <andrei.golubev@qt.io> | 2022-05-12 14:39:38 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-06-10 12:06:49 +0000 |
commit | 7373e6149f7e28fff1dfc5b5642d63aa4bb5a886 (patch) | |
tree | 90359e9ef7b2e130ac8df3ffab1289da7d4bc0df /tools/qmltc/qmltccompilerpieces.h | |
parent | 7360c1af181dc6ef3ae82a885ada0dc6919c85f7 (diff) |
qmltc: Move from QmlIR::Binding to QQmlJSMetaPropertyBinding
This symbolizes the last piece of QmlIR dependency that qmltc has.
We do still have some implicit dependencies on QmlIR, though, but
that should go way once the remaining prototype code's logic is
migrated to QmltcVisitor, QQmlJSScope and friends. This, however,
is not attempted here as the patch itself is rather large
In the process of switching to QQmlJSMetaPropertyBinding, observe
and fix issues in QmltcVisitor and surroundings
Change-Id: I752b68a7f57baf354de16dc0bb466a3f693a4e49
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
(cherry picked from commit bf7aaeda87d409253f8d114273cc71f4244973af)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tools/qmltc/qmltccompilerpieces.h')
-rw-r--r-- | tools/qmltc/qmltccompilerpieces.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/qmltc/qmltccompilerpieces.h b/tools/qmltc/qmltccompilerpieces.h index 2544e5fd9f..545e347caf 100644 --- a/tools/qmltc/qmltccompilerpieces.h +++ b/tools/qmltc/qmltccompilerpieces.h @@ -89,7 +89,8 @@ struct QmltcCodeGenerator inline QString generate_typeCount(Predicate p) const; static void generate_callExecuteRuntimeFunction(QStringList *block, const QString &url, - qsizetype index, const QString &accessor, + QQmlJSMetaMethod::AbsoluteFunctionIndex index, + const QString &accessor, const QString &returnType, const QList<QmltcVariable> ¶meters = {}); @@ -233,8 +234,11 @@ inline decltype(auto) QmltcCodeGenerator::generate_initCode(QmltcType ¤t, if (int id = visitor->runtimeId(type); id >= 0) { current.init.body << u"// 3. set id since it is provided"_s; + QString idString = visitor->addressableScopes().id(type); + if (idString.isEmpty()) + idString = u"<unknown>"_s; QmltcCodeGenerator::generate_setIdValue(¤t.init.body, u"context"_s, id, u"this"_s, - u"<unknown>"_s); + idString); } // if type has an extension, create a dynamic meta object for it |