diff options
author | Robin Burchell <robin.burchell@crimson.no> | 2019-02-12 14:37:23 +0100 |
---|---|---|
committer | Robin Burchell <robin.burchell@crimson.no> | 2019-03-21 03:08:27 +0000 |
commit | 8704c640946ac852668638e2980d3e2b78aa27ae (patch) | |
tree | 9a7e94700108fcd90015cb51468adf399d9a66d9 /src/qml/types | |
parent | d2fd8010d3d3a6493df1a848c342db40555b4c1f (diff) |
QV4Engine: Unify fromValue and metaTypeToJS
Somehow, we ended up with two codepaths doing essentially the same
thing: constructing a JS value from a QVariant. metaTypeToJS is invoked
from QJSEngine::toScriptValue, whereas fromVariant() is used in various
places internally.
metaTypeToJS lacks proper handling for a number of cases, such as
builtin types like QPointF, which lead to toScriptValue(QPointF)
(incorrectly, and uselessly) constructing a VariantObject which couldn't
then do anything useful.
[ChangeLog][QtQml] QJSEngine::toScriptValue will now return correct
JavaScript objects in more cases, for example, for gadget types like
QPointF.
[ChangeLog][QtQml] QJSEngine::toScriptValue now uses the same
behavior as the rest of the engine when building JavaScript values, which
will cause the types of some returned JavaScript objects to change. For
instance, string lists are now returned as sequence objects, not array
objects, and QChar now constructs a JavaScript string.
Change-Id: I0290eb7c9c46e7b508d497cc33cd61d9378f3872
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/qml/types')
0 files changed, 0 insertions, 0 deletions