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

Something like MathJSON in QML. Is there any for iOS/Android?



  • Hello!
    I am tying to find something like https://gist.github.com/laughinghan/4350e4438e6cfc951826 but for using it in QML for iOS/Android.
    For example - I have array of arrays:

    [
    	[["Field_01",465],["Field_02",465],["Field_03",465],["Field_04",465],["Field_05",465]],
    	[["Field_01",465],["Field_02",465],["Field_03",465],["Field_04",465],["Field_05",465]],
    	[["Field_01",465],["Field_02",465],["Field_03",465],["Field_04",465],["Field_05",465]],
    	[["Field_01",465],["Field_02",465],["Field_03",465],["Field_04",465],["Field_05",465]]
    ]
    

    And I am getting from server formula, something like this:

    Field_01 * 15 / 25 + Field_03 * 2
    

    or

    (Field_01 + Field_02) / 5 + Field_04
    

    or any other formula.

    Is there any solution for this kind of issues in Qt/QML?



  • Solution found issue closed.

    The formula should be in JavaScript compatible format and using https://doc.qt.io/qt-5/qjsengine.html

    QJSEngine myEngine;
    QJSValue three = myEngine.evaluate("1 + 2");
    

Log in to reply