Thread object which executes a script with a QScriptEngine.
More...
#include <scriptThread.h>
|
void | onGetVariables (const QString &propertyName) |
| Catch variables values from current script execution. More...
|
|
Thread object which executes a script with a QScriptEngine.
ScriptThread::ScriptThread |
( |
Threading & |
threading, |
|
|
const QString & |
id, |
|
|
QScriptEngine * |
engine, |
|
|
const QString & |
script |
|
) |
| |
Constructor.
- Parameters
-
threading | - threading manager for this thread |
engine | - QScriptEngine which will do the work |
script | - a Qt Script to run |
ScriptThread::~ScriptThread |
( |
| ) |
|
|
override |
void ScriptThread::abort |
( |
| ) |
|
Aborts execution. Asynchronous: a thread will not be finished on return from this function.
QString ScriptThread::error |
( |
| ) |
const |
- Returns
- error message or empty string if evalutation succeed
QString ScriptThread::id |
( |
| ) |
const |
- Returns
- string id of the thread
bool ScriptThread::isEvaluating |
( |
| ) |
const |
- Returns
- true if the script engine is evaluating a script at the moment
void ScriptThread::onGetVariables |
( |
const QString & |
propertyName | ) |
|
|
slot |
Catch variables values from current script execution.
- Parameters
-
propertyName | - name of variables prefix, i.e prefix "web" for variable "web.light" |
void ScriptThread::run |
( |
| ) |
|
|
overrideprotected |
void trikScriptRunner::ScriptThread::stopRunning |
( |
| ) |
|
|
signal |
Emitted when event loop must be stopped.
void trikScriptRunner::ScriptThread::variablesReady |
( |
const QJsonObject & |
json | ) |
|
|
signal |
Emitted when variables values are ready.
- Parameters
-
json | - JSON container for variables values |
The documentation for this class was generated from the following files: