Iterate through all my QScript engines' possible commands.



  • I have added various objects from my main app to the script engine that seem to be responding well until now (I can use all of their methods defined in the public slots). Yet I believe it would be nice if I was able to print what those methods are (e.g. what can and can't someone type in the script engine).

    In a few words what I want to do is iterate through all available functions of the objects exposed to my script engine and store them in a list, what I have until now is

    @QStringList ScriptClassr::availableCommands()
    {
    QScriptValue app = myengine->globalObject();
    QScriptValueIterator it(app);
    while (it.hasNext()) {
    it.next();
    commands << it.name();
    }

    return commands;
    

    }@

    commands is just a QScriptList.

    This however does not include the various functions that I am interested in.
    Is there any possible way to achieve what I am after?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.