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. Overwrite functions(methods) on script side

Overwrite functions(methods) on script side

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.3k Views
  • 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.
  • 2 Offline
    2 Offline
    2beers
    wrote on 6 Aug 2011, 23:10 last edited by
    #1

    Hi everyone. I'm playing with QScript module and I'm following this "tutorial":http://doc.qt.nokia.com/4.7-snapshot/scripting.html .
    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();
    task.run=function(){
    print("Hello world");
    }@

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

    1 Reply Last reply
    0

    1/1

    6 Aug 2011, 23:10

    • Login

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