Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
exampleqjsengine.cpp File Reference

Go to the source code of this file.

Functions

val property ("f")
 
 qDebug ()<< engine.hasError()
 [1]
 
QJSManagedValue managed (std::move(val), &engine)
 
 Q_ASSERT (error.toInt(), 42)
 

Variables

QJSEngine engine
 [qjs-engine-example]
 
auto val = engine.evaluate("let o = { get f() {throw 42;} }; o")
 
QJSValue error = engine.catchError()
 

Function Documentation

◆ managed()

QJSManagedValue managed ( std::move(val ,
engine 
)

Referenced by QV4::Value::cast(), QV4::Value::cast(), QJSManagedValue::prototype(), and writeToConsole().

+ Here is the caller graph for this function:

◆ property()

val property ( "f"  )

◆ Q_ASSERT()

Q_ASSERT ( error.  toInt(),
42   
)

◆ qDebug()

qDebug ( )

[1]

[7]

[toString]

Variable Documentation

◆ engine

QJSEngine engine

[qjs-engine-example]

Definition at line 6 of file exampleqjsengine.cpp.

◆ error

QJSValue error = engine.catchError()

Definition at line 18 of file exampleqjsengine.cpp.

◆ val

val = engine.evaluate("let o = { get f() {throw 42;} }; o")

Definition at line 8 of file exampleqjsengine.cpp.