aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlcompiler/qqmljsfunctioninitializer.cpp
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 /src/qmlcompiler/qqmljsfunctioninitializer.cpp
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>
Diffstat (limited to 'src/qmlcompiler/qqmljsfunctioninitializer.cpp')
-rw-r--r--src/qmlcompiler/qqmljsfunctioninitializer.cpp10
1 files changed, 5 insertions, 5 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(