diff options
author | Michael Bruning <michael.bruning@theqtcompany.com> | 2016-04-12 15:14:55 +0200 |
---|---|---|
committer | Michael BrĂ¼ning <michael.bruning@theqtcompany.com> | 2016-04-20 13:38:31 +0000 |
commit | 0b7c11e7c2bb457bff399fdec38d9cf266e89a86 (patch) | |
tree | ab2567e5bd48d406079bb9d57dafb6a333561a60 /src/qml | |
parent | 9c8dab537819f0d999e680490c2d125b8836cbbb (diff) |
Also match QJSValue conversion types in MatchScore.
This had the effect that overloaded methods were always mapped to the
wrong slot.
[ChangeLog][QtQml][Important Behavior Changes] When matching the method signature
of a invokable method to the slot in the metaobject, the matching function now
assigns the best match to a QJSValue if the parameter actually is a QJSValue. This
corrects the previous behavior, where QJSValue and int were given the same match score
even though QJSValue would have been the best match.
Task-number: QTBUG-51746
Change-Id: I906e7b006ee5af92ea760ed1625e5047aef123bf
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml')
-rw-r--r-- | src/qml/jsruntime/qv4qobjectwrapper.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp index bcd97efee8..6be86e3bdb 100644 --- a/src/qml/jsruntime/qv4qobjectwrapper.cpp +++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp @@ -1270,6 +1270,8 @@ static int MatchScore(const QV4::Value &actual, int conversionType) return 10; } else if (conversionType == QMetaType::QJsonObject) { return 5; + } else if (conversionType == qMetaTypeId<QJSValue>()) { + return 0; } else { return 10; } |