QJSValue
QJSValue is a value type in Qt that represents a JavaScript value within the Qt JavaScript engine (QJSEngine). It can hold JavaScript primitives such as undefined, null, boolean, number, and string, as well as objects, arrays, and functions. A QJSValue can therefore model any value that can be manipulated from within JavaScript, including complex objects created or exposed from C++.
A key aspect of QJSValue is its type inspection and conversion capabilities. It provides predicates such as
If the value represents a JavaScript function, it can be invoked from C++ with a specified this
Lifecycle and usage notes: QJSValue is a lightweight handle whose semantics are tied to the owning QJSEngine.