Цитата
QScriptValue QScriptEngine::evaluate ( const QString & program, const QString & fileName = QString(), int lineNumber = 1 )
Evaluates program, using lineNumber as the base line number, and returns the result of the evaluation.
The script code will be evaluated in the current context.
Evaluates program, using lineNumber as the base line number, and returns the result of the evaluation.
The script code will be evaluated in the current context.
Но в действительности получается что каждый evaluate создаёт свой контекст и ...
evaluate ("var x = 2");
evaluate ("var y = 3");
evaluate ("var z = x + y");
z не вычисляется, т.к. в его контексте нет x & y ?!
Это при условии что вызов evaluate происходит из _разных_ объектов, но по единому указателю QScriptEngine .
Вопрос - возможно-ли сохранить единый контекст для ВСЕХ evaluate ?
(до пере-инициализации QScriptEngine, ес-сно)
Заранее благодарен за помощь !