diff options
author | Robin Burchell <robin.burchell@crimson.no> | 2017-01-11 21:08:23 +0100 |
---|---|---|
committer | Robin Burchell <robin.burchell@crimson.no> | 2017-01-12 16:36:24 +0000 |
commit | fd0d4464533ae773a5b70cb803b25fd97b6f09a0 (patch) | |
tree | b33cb2027c6a8b49cc37270826270ecf27040431 /src/qml/jsapi | |
parent | 9ce6712c981c312f5c417c58b0d578d872af428a (diff) |
QJSValue: Mention how to construct QJSValue from other non-obvious types
This has come up in queries from users, so let's add a helping hand.
Change-Id: If4e5efdd8969a71a78fc88ae168ede8d681858aa
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsapi')
-rw-r--r-- | src/qml/jsapi/qjsvalue.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qml/jsapi/qjsvalue.cpp b/src/qml/jsapi/qjsvalue.cpp index b473e96286..bab2e633a7 100644 --- a/src/qml/jsapi/qjsvalue.cpp +++ b/src/qml/jsapi/qjsvalue.cpp @@ -73,7 +73,8 @@ For the object-based types (including Date and RegExp), use the newT() functions in QJSEngine (e.g. QJSEngine::newObject()) to create a QJSValue of the desired type. For the primitive types, - use one of the QJSValue constructor overloads. + use one of the QJSValue constructor overloads. For other types, e.g. + registered gadget types such as QPoint, you can use QJSEngine::toScriptValue. The methods named isT() (e.g. isBool(), isUndefined()) can be used to test if a value is of a certain type. The methods named |