diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2022-11-15 10:13:09 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2022-11-15 14:26:17 +0100 |
commit | 7b29ed6f64a300d4d714371c2872fcba344beebd (patch) | |
tree | d2e83316030d03a05317958e22770bb784ffcbe0 /src/qml/jsruntime/qv4engine_p.h | |
parent | d9d247746423f6a9f1f36aa9be14fad1edcd6616 (diff) |
QJSEngine: Provide a method to coerce values in JS fashion
JavaScript has its own type coercion rules. We already have a methods
that coerce QVariants, QJSValues and QJSManagedValues to specific types.
The new method is a generalization of all of those and can coerce
everything to everything (as far as JavaScript can).
Change-Id: I9b6877fb40f67b6f2354781bbd4cf18cf996c7b0
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4engine_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4engine_p.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4engine_p.h b/src/qml/jsruntime/qv4engine_p.h index 067ddc7243..5434f55548 100644 --- a/src/qml/jsruntime/qv4engine_p.h +++ b/src/qml/jsruntime/qv4engine_p.h @@ -740,13 +740,14 @@ public: QV4::ReturnedValue callInContext(QV4::Function *function, QObject *self, QV4::ExecutionContext *ctxt, int argc, const QV4::Value *argv); + QV4::ReturnedValue fromData( + QMetaType type, const void *ptr, + Heap::Object *parent = nullptr, int property = -1, uint flags = 0); + private: template<int Frames> friend struct ExecutionEngineCallDepthRecorder; - QV4::ReturnedValue fromData( - QMetaType type, const void *ptr, - Heap::Object *parent = nullptr, int property = -1, uint flags = 0); static void initializeStaticMembers(); static int s_maxCallDepth; |