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
QHarmonyAppJsContext Class Reference

\inmodule QtCore More...

Collaboration diagram for QHarmonyAppJsContext:

Detailed Description

\inmodule QtCore

The QHarmonyAppJsContext class gives code on the JS thread of a HarmonyOS application access to the application's state.

QHarmonyJsContext describes the JS runtime. QHarmonyAppJsContext holds the state of the application in that runtime, such as its default UIAbility instance. Keeping the two apart makes function signatures meaningful. A function that takes a QHarmonyAppJsContext depends on the application's state. A function that takes a QHarmonyJsContext needs only the runtime. A task gets the application context once, with fromJsContext(), and passes it on.

The class derives from QHarmonyJsContext, and there is only one object. QHarmonyJsContext::fromEnv() returns it as the base class. All member functions must be called on the JS thread. References to it and its napi_value results follow the lifetime rules of QHarmonyJsContext.

See also
{Qt for HarmonyOS Platform API}

The documentation for this class was generated from the following file: