aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsapi/qjsvalue.cpp
diff options
context:
space:
mode:
authorRobin Burchell <robin.burchell@crimson.no>2017-01-11 21:08:23 +0100
committerRobin Burchell <robin.burchell@crimson.no>2017-01-12 16:36:24 +0000
commitfd0d4464533ae773a5b70cb803b25fd97b6f09a0 (patch)
treeb33cb2027c6a8b49cc37270826270ecf27040431 /src/qml/jsapi/qjsvalue.cpp
parent9ce6712c981c312f5c417c58b0d578d872af428a (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/qjsvalue.cpp')
-rw-r--r--src/qml/jsapi/qjsvalue.cpp3
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