Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Hellow, i need to create script math parser, for example i have this string: 1+2+3, and i want to find answer with scripts, how can i do it?
@ QScriptEngine scriptEngine;
QScriptValue scriptLineEdit = scriptEngine.newQObject(lineEdit);
scriptEngine.evaluate("var answer = lineEdit.txt;" //<---
"lineEdit.text = answer;");@
How can I make so that the line was interpreted as a command, not a string?
Use eval() function.
Could you tell me more about this function, as assistant about i found nothing it
It is js function, you can read more about it "here":http://www.w3schools.com/jsref/jsref_eval.asp
It is work, thank you for your help!
You are welcome, please add [solved] to your post title