aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSami Shalayel <sami.shalayel@qt.io>2022-11-10 11:38:51 +0100
committerSami Shalayel <sami.shalayel@qt.io>2022-12-02 10:39:48 +0100
commit784367ad1722a550e83e4925da2d4809adeca750 (patch)
treed55307c1628289fab71eebf4d34583e7a07b3e7b
parent591306fb07346065482f796f6caf4bf7e0d8e826 (diff)
QQmlJSMetaParameter: Encapsulate parameter information
Previously, there were four lists that contained each one entry for each parameter. There was one list responsible for the names, types, type names and const-qualifiers but this was quite bothersome to use (e.g. they not always had the same length). This commit introduces QQmlJSMetaParameter to encapsulate all the information required when manipulating parameters. This reduce the 4 lists to one, making parameters easier to handle and QQmlJSMetaMethod easier to read. This is a purely refactoring change, no new functionality was added. Task-number: QTBUG-107625 Change-Id: Ia41b823c9e6294ee26e828071b802cac6b4058ce Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
-rw-r--r--src/qmlcompiler/qqmljsfunctioninitializer.cpp10
-rw-r--r--src/qmlcompiler/qqmljsimportvisitor.cpp22
-rw-r--r--src/qmlcompiler/qqmljslinter.cpp18
-rw-r--r--src/qmlcompiler/qqmljsmetatypes_p.h111
-rw-r--r--src/qmlcompiler/qqmljsscope.cpp23
-rw-r--r--src/qmlcompiler/qqmljstypedescriptionreader.cpp5
-rw-r--r--src/qmlcompiler/qqmljstypepropagator.cpp24
-rw-r--r--src/qmldom/qqmldomtypesreader.cpp9
-rw-r--r--tools/qmltc/qmltccompiler.cpp36
-rw-r--r--tools/qmltc/qmltcvisitor.cpp4
10 files changed, 135 insertions, 127 deletions
diff --git a/src/qmlcompiler/qqmljsfunctioninitializer.cpp b/src/qmlcompiler/qqmljsfunctioninitializer.cpp
index b3c448072c..fc0cdb2848 100644
--- a/src/qmlcompiler/qqmljsfunctioninitializer.cpp
+++ b/src/qmlcompiler/qqmljsfunctioninitializer.cpp
@@ -171,12 +171,12 @@ QQmlJSCompilePass::Function QQmlJSFunctionInitializer::run(
for (const auto &method : methods) {
if (method.methodType() == QQmlJSMetaMethod::Signal) {
function.isSignalHandler = true;
- const auto argumentTypes = method.parameterTypes();
- for (qsizetype i = 0, end = argumentTypes.size(); i < end; ++i) {
- const auto &type = argumentTypes[i];
+ const auto arguments = method.parameters();
+ for (qsizetype i = 0, end = arguments.size(); i < end; ++i) {
+ const auto &type = arguments[i].type();
if (type.isNull()) {
- diagnose(u"Cannot resolve the argument type %1."_s
- .arg(method.parameterTypeNames()[i]),
+ diagnose(u"Cannot resolve the argument type %1."_s.arg(
+ arguments[i].typeName()),
QtDebugMsg, bindingLocation, error);
function.argumentTypes.append(
m_typeResolver->tracked(
diff --git a/src/qmlcompiler/qqmljsimportvisitor.cpp b/src/qmlcompiler/qqmljsimportvisitor.cpp
index 84cb2b4c63..9f6ada298e 100644
--- a/src/qmlcompiler/qqmljsimportvisitor.cpp
+++ b/src/qmlcompiler/qqmljsimportvisitor.cpp
@@ -983,7 +983,10 @@ void QQmlJSImportVisitor::checkSignals()
continue;
}
- const QStringList signalParameters = signalMethod->parameterNames();
+ const auto signalParameters = signalMethod->parameters();
+ QHash<QString, qsizetype> parameterNameIndexes;
+ for (int i = 0; i < signalParameters.size(); i++)
+ parameterNameIndexes[signalParameters[i].name()] = i;
if (pair.second.size() > signalParameters.size()) {
m_logger->log(QStringLiteral("Signal handler for \"%2\" has more formal"
@@ -995,8 +998,12 @@ void QQmlJSImportVisitor::checkSignals()
for (qsizetype i = 0; i < pair.second.size(); i++) {
const QStringView handlerParameter = pair.second.at(i);
- const qsizetype j = signalParameters.indexOf(handlerParameter);
- if (j == i || j < 0)
+ auto it = parameterNameIndexes.constFind(handlerParameter.toString());
+ if (it == parameterNameIndexes.constEnd())
+ continue;
+ const qsizetype j = *it;
+
+ if (j == i)
continue;
m_logger->log(QStringLiteral("Parameter %1 to signal handler for \"%2\""
@@ -1430,8 +1437,8 @@ bool QQmlJSImportVisitor::visit(UiPublicMember *publicMember)
method.setMethodType(QQmlJSMetaMethod::Signal);
method.setMethodName(publicMember->name.toString());
while (param) {
- method.addParameter(param->name.toString(), buildName(param->type),
- QQmlJSMetaMethod::NonConst);
+ method.addParameter(
+ QQmlJSMetaParameter(param->name.toString(), buildName(param->type)));
param = param->next;
}
m_currentScope->addOwnMethod(method);
@@ -1586,11 +1593,10 @@ void QQmlJSImportVisitor::visitFunctionExpressionHelper(QQmlJS::AST::FunctionExp
const QString type = parameter.typeName();
if (type.isEmpty()) {
formalsFullyTyped = false;
- method.addParameter(parameter.id, QStringLiteral("var"),
- QQmlJSMetaMethod::NonConst);
+ method.addParameter(QQmlJSMetaParameter(parameter.id, QStringLiteral("var")));
} else {
anyFormalTyped = true;
- method.addParameter(parameter.id, type, QQmlJSMetaMethod::NonConst);
+ method.addParameter(QQmlJSMetaParameter(parameter.id, type));
}
}
}
diff --git a/src/qmlcompiler/qqmljslinter.cpp b/src/qmlcompiler/qqmljslinter.cpp
index f8bca749fe..fe4a8a9acf 100644
--- a/src/qmlcompiler/qqmljslinter.cpp
+++ b/src/qmlcompiler/qqmljslinter.cpp
@@ -705,18 +705,20 @@ QQmlJSLinter::LintResult QQmlJSLinter::lintModule(const QString &module, const b
+ scope->internalName() + u'.' + method.methodName() + u"()"_s;
}
- const auto paramTypeNames = method.parameterTypeNames();
- const auto paramTypes = method.parameterTypes();
- for (qsizetype i = 0; i < paramTypeNames.size(); i++) {
- if (paramTypeNames[i].isEmpty())
+ const auto parameters = method.parameters();
+ for (qsizetype i = 0; i < parameters.size(); i++) {
+ auto &parameter = parameters[i];
+ const QString typeName = parameter.typeName();
+ const QSharedPointer<const QQmlJSScope> type = parameter.type();
+ if (typeName.isEmpty())
continue;
- if (paramTypes[i].isNull()) {
- missingTypes[paramTypeNames[i]] << u"parameter %1 of "_s.arg(i + 1)
+ if (type.isNull()) {
+ missingTypes[typeName] << u"parameter %1 of "_s.arg(i + 1)
+ scope->internalName() + u'.' + method.methodName() + u"()"_s;
continue;
}
- if (!paramTypes[i]->isFullyResolved()) {
- partiallyResolvedTypes[paramTypeNames[i]] << u"parameter %1 of "_s.arg(i + 1)
+ if (!type->isFullyResolved()) {
+ partiallyResolvedTypes[typeName] << u"parameter %1 of "_s.arg(i + 1)
+ scope->internalName() + u'.' + method.methodName() + u"()"_s;
continue;
}
diff --git a/src/qmlcompiler/qqmljsmetatypes_p.h b/src/qmlcompiler/qqmljsmetatypes_p.h
index 62df5a3940..66a770ea07 100644
--- a/src/qmlcompiler/qqmljsmetatypes_p.h
+++ b/src/qmlcompiler/qqmljsmetatypes_p.h
@@ -106,17 +106,9 @@ public:
}
};
-class QQmlJSMetaMethod
+class QQmlJSMetaParameter
{
public:
- enum Type { Signal, Slot, Method, StaticMethod };
-
- enum Access {
- Private,
- Protected,
- Public
- };
-
/*!
\internal
A non-const parameter is passed either by pointer or by value, depending on its access
@@ -128,6 +120,55 @@ public:
Const,
};
+ QQmlJSMetaParameter(const QString &name, const QString &typeName,
+ Constness typeQualifier = NonConst,
+ QWeakPointer<const QQmlJSScope> type = {})
+ : m_name(name), m_typeName(typeName), m_type(type), m_typeQualifier(typeQualifier)
+ {
+ }
+
+ QString name() const { return m_name; }
+ void setName(const QString &name) { m_name = name; }
+ QString typeName() const { return m_typeName; }
+ void setTypeName(const QString &typeName) { m_typeName = typeName; }
+ QSharedPointer<const QQmlJSScope> type() const { return m_type.toStrongRef(); }
+ void setType(QWeakPointer<const QQmlJSScope> type) { m_type = type; }
+ Constness typeQualifier() const { return m_typeQualifier; }
+ void setTypeQualifier(Constness typeQualifier) { m_typeQualifier = typeQualifier; }
+
+ friend bool operator==(const QQmlJSMetaParameter &a, const QQmlJSMetaParameter &b)
+ {
+ return a.m_name == b.m_name && a.m_typeName == b.m_typeName
+ && a.m_type.toStrongRef().data() == b.m_type.toStrongRef().data()
+ && a.m_typeQualifier == b.m_typeQualifier;
+ }
+
+ friend bool operator!=(const QQmlJSMetaParameter &a, const QQmlJSMetaParameter &b)
+ {
+ return !(a == b);
+ }
+
+ friend size_t qHash(const QQmlJSMetaParameter &e, size_t seed = 0)
+ {
+ return qHashMulti(seed, e.m_name, e.m_typeName, e.m_type.toStrongRef().data(),
+ e.m_typeQualifier);
+ }
+
+private:
+ QString m_name;
+ QString m_typeName;
+ QWeakPointer<const QQmlJSScope> m_type;
+ Constness m_typeQualifier = NonConst;
+};
+
+class QQmlJSMetaMethod
+{
+public:
+ enum Type { Signal, Slot, Method, StaticMethod };
+
+ enum Access { Private, Protected, Public };
+
+public:
/*! \internal
Represents a relative JavaScript function/expression index within a type
@@ -162,36 +203,20 @@ public:
m_returnType = type;
}
- QStringList parameterNames() const { return m_paramNames; }
- QStringList parameterTypeNames() const { return m_paramTypeNames; }
- QList<QSharedPointer<const QQmlJSScope>> parameterTypes() const
+ QList<QQmlJSMetaParameter> parameters() const { return m_parameters; }
+
+ QStringList parameterNames() const
{
- QList<QSharedPointer<const QQmlJSScope>> result;
- for (const auto &type : m_paramTypes)
- result.append(type.toStrongRef());
- return result;
+ QStringList names;
+ for (const auto &p : m_parameters)
+ names.append(p.name());
+
+ return names;
}
- QList<Constness> parameterTypeQualifiers() const { return m_paramTypeQualifiers; }
+ void setParameters(const QList<QQmlJSMetaParameter> &parameters) { m_parameters = parameters; }
- void setParameterTypes(const QList<QSharedPointer<const QQmlJSScope>> &types,
- const QList<Constness> &flags)
- {
- Q_ASSERT(types.size() == m_paramNames.size());
- Q_ASSERT(flags.size() == m_paramNames.size());
- m_paramTypes.clear();
- m_paramTypeQualifiers = flags;
- for (const auto &type : types)
- m_paramTypes.append(type);
- }
- void addParameter(const QString &name, const QString &typeName, const Constness &flag,
- const QSharedPointer<const QQmlJSScope> &type = {})
- {
- m_paramNames.append(name);
- m_paramTypeNames.append(typeName);
- m_paramTypes.append(type);
- m_paramTypeQualifiers.append(flag);
- }
+ void addParameter(const QQmlJSMetaParameter &p) { m_parameters.append(p); }
int methodType() const { return m_methodType; }
void setMethodType(Type methodType) { m_methodType = methodType; }
@@ -227,9 +252,7 @@ public:
friend bool operator==(const QQmlJSMetaMethod &a, const QQmlJSMetaMethod &b)
{
return a.m_name == b.m_name && a.m_returnTypeName == b.m_returnTypeName
- && a.m_returnType == b.m_returnType && a.m_paramNames == b.m_paramNames
- && a.m_paramTypeNames == b.m_paramTypeNames && a.m_paramTypes == b.m_paramTypes
- && a.m_paramTypeQualifiers == b.m_paramTypeQualifiers
+ && a.m_returnType == b.m_returnType && a.m_parameters == b.m_parameters
&& a.m_annotations == b.m_annotations && a.m_methodType == b.m_methodType
&& a.m_methodAccess == b.m_methodAccess && a.m_revision == b.m_revision
&& a.m_isConstructor == b.m_isConstructor;
@@ -247,16 +270,15 @@ public:
seed = combine(seed, method.m_name);
seed = combine(seed, method.m_returnTypeName);
seed = combine(seed, method.m_returnType.toStrongRef().data());
- seed = combine(seed, method.m_paramNames);
- seed = combine(seed, method.m_paramTypeNames);
seed = combine(seed, method.m_annotations);
seed = combine(seed, method.m_methodType);
seed = combine(seed, method.m_methodAccess);
seed = combine(seed, method.m_revision);
seed = combine(seed, method.m_isConstructor);
- for (const auto &type : method.m_paramTypes)
- seed = combine(seed, type.toStrongRef().data());
+ for (const auto &type : method.m_parameters) {
+ seed = combine(seed, type);
+ }
return seed;
}
@@ -266,10 +288,7 @@ private:
QString m_returnTypeName;
QWeakPointer<const QQmlJSScope> m_returnType;
- QStringList m_paramNames;
- QStringList m_paramTypeNames;
- QList<QWeakPointer<const QQmlJSScope>> m_paramTypes;
- QList<Constness> m_paramTypeQualifiers;
+ QList<QQmlJSMetaParameter> m_parameters;
QList<QQmlJSAnnotation> m_annotations;
Type m_methodType = Signal;
diff --git a/src/qmlcompiler/qqmljsscope.cpp b/src/qmlcompiler/qqmljsscope.cpp
index 3ce732a742..b1397981be 100644
--- a/src/qmlcompiler/qqmljsscope.cpp
+++ b/src/qmlcompiler/qqmljsscope.cpp
@@ -502,24 +502,17 @@ QTypeRevision QQmlJSScope::resolveType(
it->setReturnType(returnType.scope);
}
- const auto paramTypeNames = it->parameterTypeNames();
- QList<QSharedPointer<const QQmlJSScope>> paramTypes = it->parameterTypes();
- if (paramTypes.size() < paramTypeNames.size())
- paramTypes.resize(paramTypeNames.size());
- QList<QQmlJSMetaMethod::Constness> paramQualifiers = it->parameterTypeQualifiers();
- if (paramQualifiers.size() < paramTypeNames.size())
- paramQualifiers.resize(paramTypeNames.size());
-
- for (int i = 0, length = paramTypes.size(); i < length; ++i) {
- auto &paramType = paramTypes[i];
- const auto paramTypeName = paramTypeNames[i];
- if (!paramType && !paramTypeName.isEmpty()) {
- const auto type = findType(paramTypeName, context, usedTypes);
- paramType = type.scope;
+ auto parameters = it->parameters();
+ for (int i = 0, length = parameters.size(); i < length; ++i) {
+ auto &parameter = parameters[i];
+ if (const QString typeName = parameter.typeName();
+ !parameter.type() && !typeName.isEmpty()) {
+ const auto type = findType(typeName, context, usedTypes);
+ parameter.setType({ type.scope });
}
}
- it->setParameterTypes(paramTypes, paramQualifiers);
+ it->setParameters(parameters);
}
return baseType.revision;
diff --git a/src/qmlcompiler/qqmljstypedescriptionreader.cpp b/src/qmlcompiler/qqmljstypedescriptionreader.cpp
index 9360119c5c..45213b104a 100644
--- a/src/qmlcompiler/qqmljstypedescriptionreader.cpp
+++ b/src/qmlcompiler/qqmljstypedescriptionreader.cpp
@@ -454,8 +454,9 @@ void QQmlJSTypeDescriptionReader::readParameter(UiObjectDefinition *ast, QQmlJSM
}
}
- metaMethod->addParameter(name, type,
- isConstant ? QQmlJSMetaMethod::Const : QQmlJSMetaMethod::NonConst);
+ QQmlJSMetaParameter p(name, type);
+ p.setTypeQualifier(isConstant ? QQmlJSMetaParameter::Const : QQmlJSMetaParameter::NonConst);
+ metaMethod->addParameter(std::move(p));
}
QString QQmlJSTypeDescriptionReader::readStringBinding(UiScriptBinding *ast)
diff --git a/src/qmlcompiler/qqmljstypepropagator.cpp b/src/qmlcompiler/qqmljstypepropagator.cpp
index b8b4222b27..71a45bbe3e 100644
--- a/src/qmlcompiler/qqmljstypepropagator.cpp
+++ b/src/qmlcompiler/qqmljstypepropagator.cpp
@@ -1126,21 +1126,21 @@ QQmlJSMetaMethod QQmlJSTypePropagator::bestMatchForCall(const QList<QQmlJSMetaMe
continue;
}
- const auto argumentTypes = method.parameterTypes();
- if (argc != argumentTypes.size()) {
- errors->append(u"Function expects %1 arguments, but %2 were provided"_s
- .arg(argumentTypes.size())
- .arg(argc));
+ const auto arguments = method.parameters();
+ if (argc != arguments.size()) {
+ errors->append(
+ u"Function expects %1 arguments, but %2 were provided"_s.arg(arguments.size())
+ .arg(argc));
continue;
}
bool matches = true;
for (int i = 0; i < argc; ++i) {
- const auto argumentType = argumentTypes[i];
+ const auto argumentType = arguments[i].type();
if (argumentType.isNull()) {
- errors->append(u"type %1 for argument %2 cannot be resolved"_s
- .arg(method.parameterTypeNames().at(i))
- .arg(i));
+ errors->append(
+ u"type %1 for argument %2 cannot be resolved"_s.arg(arguments[i].typeName())
+ .arg(i));
matches = false;
break;
}
@@ -1153,7 +1153,7 @@ QQmlJSMetaMethod QQmlJSTypePropagator::bestMatchForCall(const QList<QQmlJSMetaMe
errors->append(
u"argument %1 contains %2 but is expected to contain the type %3"_s.arg(i).arg(
m_state.registers[argv + i].descriptiveName(),
- method.parameterTypeNames().at(i)));
+ arguments[i].typeName()));
matches = false;
break;
}
@@ -1258,12 +1258,12 @@ void QQmlJSTypePropagator::propagateCall(
setError(u"Cannot store return type of method %1()."_s.arg(match.methodName()));
m_state.setHasSideEffects(true);
- const auto types = match.parameterTypes();
+ const auto types = match.parameters();
for (int i = 0; i < argc; ++i) {
if (i < types.size()) {
const QQmlJSScope::ConstPtr type = match.isJavaScriptFunction()
? m_typeResolver->jsValueType()
- : QQmlJSScope::ConstPtr(types.at(i));
+ : QQmlJSScope::ConstPtr(types.at(i).type());
if (!type.isNull()) {
addReadRegister(argv + i, m_typeResolver->globalType(type));
continue;
diff --git a/src/qmldom/qqmldomtypesreader.cpp b/src/qmldom/qqmldomtypesreader.cpp
index 69fba60047..3f83130234 100644
--- a/src/qmldom/qqmldomtypesreader.cpp
+++ b/src/qmldom/qqmldomtypesreader.cpp
@@ -73,13 +73,12 @@ void QmltypesReader::insertSignalOrMethod(const QQmlJSMetaMethod &metaMethod,
default:
Q_UNREACHABLE();
}
- QStringList pNames = metaMethod.parameterNames();
- QStringList pTypes = metaMethod.parameterTypeNames();
- qsizetype nParam = qMax(pNames.size(), pTypes.size());
+ auto parameters = metaMethod.parameters();
+ qsizetype nParam = parameters.size();
for (int i = 0; i < nParam; ++i) {
MethodParameter param;
- param.name = ((i < pNames.size()) ? pNames.at(i) : QString());
- param.typeName = ((i < pTypes.size()) ? pTypes.at(i) : QString());
+ param.name = parameters[i].name();
+ param.typeName = parameters[i].typeName();
methodInfo.parameters.append(param);
}
methodInfo.name = metaMethod.methodName();
diff --git a/tools/qmltc/qmltccompiler.cpp b/tools/qmltc/qmltccompiler.cpp
index f7d06d8e9a..a69f8619e9 100644
--- a/tools/qmltc/qmltccompiler.cpp
+++ b/tools/qmltc/qmltccompiler.cpp
@@ -412,23 +412,20 @@ void QmltcCompiler::compileEnum(QmltcType &current, const QQmlJSMetaEnum &e)
u"Q_ENUM(%1)"_s.arg(e.name()));
}
-static QList<QmltcVariable> compileMethodParameters(
- const QStringList &names, const QList<QSharedPointer<const QQmlJSScope>> &types,
- const QList<QQmlJSMetaMethod::Constness> &parameterQualifiers, bool allowUnnamed = false)
+static QList<QmltcVariable>
+compileMethodParameters(const QList<QQmlJSMetaParameter> &parameterInfos, bool allowUnnamed = false)
{
- Q_ASSERT(names.size() == types.size());
- Q_ASSERT(parameterQualifiers.size() == types.size());
-
QList<QmltcVariable> parameters;
- const auto size = names.size();
+ const auto size = parameterInfos.size();
parameters.reserve(size);
for (qsizetype i = 0; i < size; ++i) {
- Q_ASSERT(types[i]); // assume verified
- QString name = names[i];
+ const auto &p = parameterInfos[i];
+ Q_ASSERT(p.type()); // assume verified
+ QString name = p.name();
Q_ASSERT(allowUnnamed || !name.isEmpty()); // assume verified
if (name.isEmpty() && allowUnnamed)
name = u"unnamed_" + QString::number(i);
- parameters.emplaceBack(types[i]->augmentedInternalName(), name, QString());
+ parameters.emplaceBack(p.type()->augmentedInternalName(), name, QString());
}
return parameters;
}
@@ -451,14 +448,8 @@ void QmltcCompiler::compileMethod(QmltcType &current, const QQmlJSMetaMethod &m,
const QQmlJSScope::ConstPtr &owner)
{
const auto returnType = figureReturnType(m);
- const auto paramNames = m.parameterNames();
- const auto paramTypes = m.parameterTypes();
- const auto paramFlags = m.parameterTypeQualifiers();
-
- Q_ASSERT(paramNames.size() == paramTypes.size()); // assume verified
- Q_ASSERT(paramFlags.size() == paramTypes.size());
- const QList<QmltcVariable> compiledParams =
- compileMethodParameters(paramNames, paramTypes, paramFlags);
+
+ const QList<QmltcVariable> compiledParams = compileMethodParameters(m.parameters());
const auto methodType = QQmlJSMetaMethod::Type(m.methodType());
QStringList code;
@@ -917,9 +908,7 @@ void QmltcCompiler::compileAlias(QmltcType &current, const QQmlJSMetaProperty &a
setter.parameterList.emplaceBack(QQmlJSUtils::constRefify(underlyingType),
aliasName + u"_", u""_s);
} else {
- setter.parameterList = compileMethodParameters(methods.at(0).parameterNames(),
- methods.at(0).parameterTypes(),
- methods.at(0).parameterTypeQualifiers(),
+ setter.parameterList = compileMethodParameters(methods.at(0).parameters(),
/* allow unnamed = */ true);
}
@@ -1652,9 +1641,8 @@ void QmltcCompiler::compileScriptBinding(QmltcType &current,
const QString slotName = newSymbol(signalName + u"_slot");
const QString signalReturnType = figureReturnType(signal);
- const QList<QmltcVariable> slotParameters = compileMethodParameters(
- signal.parameterNames(), signal.parameterTypes(), signal.parameterTypeQualifiers(),
- /* allow unnamed = */ true);
+ const QList<QmltcVariable> slotParameters =
+ compileMethodParameters(signal.parameters(), /* allow unnamed = */ true);
// SignalHander specific:
QmltcMethod slotMethod {};
diff --git a/tools/qmltc/qmltcvisitor.cpp b/tools/qmltc/qmltcvisitor.cpp
index c777076d0c..236ad76467 100644
--- a/tools/qmltc/qmltcvisitor.cpp
+++ b/tools/qmltc/qmltcvisitor.cpp
@@ -159,9 +159,9 @@ void QmltcVisitor::findCppIncludes()
for (const QQmlJSMetaMethod &m : methods) {
findInType(m.returnType());
- const auto parameters = m.parameterTypes();
+ const auto parameters = m.parameters();
for (const auto &param : parameters)
- findInType(param);
+ findInType(param.type());
}
}