Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Iterate through all my QScript engines' possible commands.
Qt 6.11 is out! See what's new in the release blog

Iterate through all my QScript engines' possible commands.

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 470 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ealioneE Offline
    ealioneE Offline
    ealione
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved