Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

How to interpret math operation in a string [Solved]



  • Hi all,
    I have a QString with something like this:
    @
    ( ;1; + ;2; + ;3; + ;4; + ;5; + ;6; + ;7; + ;8; ) / 8
    @

    where the numbers between ';' character corresponds to some variables (in my c++ application) while the other numbers are simple arithmetical number.
    What is the fastest way to get the result from the operation described in the string?



  • do it with QtScriptEngine i think



  • [quote author="Felix" date="1296202165"]do it with QtScriptEngine i think[/quote]

    Thanks, I never used this object but it seems interesting.
    Now I try.



  • Yes it works!!!

    I love Qt!


Log in to reply