Important: Please read the Qt Code of Conduct -

Overwrite functions(methods) on script side

  • Hi everyone. I'm playing with QScript module and I'm following this "tutorial": .
    Everything is nice, but I couldn't find a way to ovewrite a function(method) on the script side.
    Let me show you what I wanna do, so you can make an ideea:
    On C++ side let's say I have a class that implements QRunnable

    @ class HelloWorldTask : public QRunnable
    void run()


    } @

    Now I want to do something create many HelloWorldTask objects on script side, and overwrite the run method. something like this:

    @var task=new HelloWorldTask();{
    print("Hello world");

    Is it possible? if not what would be the best way to achieve this?

Log in to reply