35 #include <QJsonDocument> 36 #include <QJsonObject> 75 QJSValue glob =
m_engine->globalObject();
80 glob.setProperty(
"userData", jsData);
102 QJSValue jsUserData = glob.property(
"userData");
105 glob.deleteProperty(
"userData");
QString ValueToJson(QJSValue &value)
ZblApp * m_app
An object to represent the running Zuble application.
ZblJsonHelper * m_json
An object to perform QJSValue/JSON data conversions on the fly.
QJSValue m_error
A template javascript Error object.
void execScript(qulonglong requestID, const QString &script, QString userData=QString())
Executes the specified javascript program in the current thread and sends the execComplete signal whe...
QString m_script
The most recent script that was executed.
ZScriptWorker(ZScriptThread *container=nullptr, QObject *parent=nullptr)
A thread class to support Zuble's background Javascript processing.
bool isError()
Determines if an error state exists for this thread.
QJSValue m_result
Result returned by the most recent script execution.
static void zInit()
This method must be called once at the start of each thread that throws or catches ZblException objec...
void execComplete(qulonglong requestID, QString result, QString userData)
Sent when the a javascript program execution started with execScript() has been completed.
void onStarted()
Called when QThread has started running.
QJSValue JsonTextToValue(QString jsonText)
Converts objects between JSON and QJSValue domains for a specific QJSEngine instance.
The primary QML API to the Zuble plugin library. Zuble applications access this object through the ja...
QJSValue error()
returns the internal Error object for this thread saved in thread local storage.
QJSValue convertEvaluateError(const QJSValue &evaluateError)
Javascript syntax errors appear to be passing back a string object with the QJSValue error bit set...
QJSEngine * m_engine
The javascript engine for background processing.
Zuble's Qt Exception Object.