trikScriptRunner/src/scriptThread.cpp
void ScriptThread::onGetVariables(const QString &propertyName)
{
	if (mEngine != nullptr) {
		QScriptValueIterator it(mEngine->globalObject().property(propertyName));
		QJsonObject json;
		while (it.hasNext()) {
			it.next();
			json[it.name()] = it.value().toString();
		}
		emit variablesReady(json);
	}
}
// TODO: Fix design error. This slot is called on wrong thread (probably)
// mEngine must be accessed from the correct worker thread instead
Fix design error. This slot is called on wrong thread (probably)
mEngine must be accessed from the correct worker thread instead
Fix design error . This slot is called on wrong thread ( probably ) mEngine must be accessed from the correct worker thread instead
void ScriptThread::onGetVariables(const QString &propertyName)
{
	if (mEngine != nullptr) {
		QScriptValueIterator it(mEngine->globalObject().property(propertyName));
		QJsonObject json;
		while (it.hasNext()) {
			it.next();
			json[it.name()] = it.value().toString();
		}
		emit variablesReady(json);
	}
}
void ScriptThread :: onGetVariables ( const QString & propertyName ) { if ( mEngine != nullptr ) { QScriptValueIterator it ( mEngine -> globalObject ( ) . property ( propertyName ) ) ; QJsonObject json ; while ( it . hasNext ( ) ) { it . next ( ) ; json [ it . name ( ) ] = it . value ( ) . toString ( ) ; } emit variablesReady ( json ) ; } }
TODO: Fix design error.
TODO : Fix design error .