Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qjsengine.cpp
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4//![qjs-engine]
5
7 QJSValue object = engine.newObject();
8 object.setProperty("num", 42);
9 QJSValue function = engine.evaluate("(o) => o.num *= 2 ");
10 QJSValueList args = { object };
11 QJSValue result = function.call(args);
13 Q_ASSERT(result.equals(expected) && !result.strictlyEquals(expected));
14
15//![qjs-engine]
QJSValue expected
Definition qjsengine.cpp:12
QJSValue function
Definition qjsengine.cpp:9
Q_ASSERT(error.toInt(), 42)
CallableWithState object
QJSValueList args
QJSEngine engine
[0]