c++qtqjsonobject

QJsonObject how to create function


I know how to create members and values in a QJsonObject. What I want to do is create a Json function that when called will call the assigned function.

Is this possible?


Solution

  • I think that is not possible, functions are not a valid json value.

    Valid json values are : string, number, object, array, boolean or null.

    In Qt, valid QJsonValues are: bool QJsonValue::Bool, QJsonValue::Double, QJsonValue::String, QJsonValue::Array, QJsonValue::Object, QJsonValue::Null

    json spec