Results 1 to 4 of 4

Thread: How to send an argument to Javascript function using QScriptEngine

  1. #1
    Join Date
    Mar 2013
    Posts
    43
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default How to send an argument to Javascript function using QScriptEngine

    How to send an argument to Javascript function using QScriptEngine
    Please give me an example code

    Thanks & Regards,
    Mythili

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to send an argument to Javascript function using QScriptEngine

    Quote Originally Posted by mythili View Post
    How to send an argument to Javascript function using QScriptEngine
    Please give me an example code
    You should probably do this first
    What does your script look like, which function do you want to call, what kind of arguments you want to pass.

    Cheers,
    _

  3. #3
    Join Date
    Mar 2013
    Posts
    43
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to send an argument to Javascript function using QScriptEngine

    I have a mathematical equation like 1+3+qSin(90)*4 as a string
    I need to call js by passing this as an argument to a function
    Function in js need to evaluate and return a value again to qt.

    Thanks,
    Mythili

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to send an argument to Javascript function using QScriptEngine

    Not bad for a second try

    If you now also add the JavaScript snippet of the function that you want to call, at least its name, then people might be able to given you a code snippet back.

    Unless you changed your mind and want an abstract answer for your abstract question.

    Cheers,
    _

Similar Threads

  1. How to add class member function in QScriptEngine
    By Sacha_D in forum Qt Programming
    Replies: 2
    Last Post: 23rd April 2013, 16:10
  2. pass member function as argument int template function
    By bibhukalyana in forum General Programming
    Replies: 1
    Last Post: 12th March 2013, 07:05
  3. Replies: 5
    Last Post: 23rd October 2010, 00:52
  4. Replies: 3
    Last Post: 14th October 2008, 21:04
  5. Interpretting javascript using QScriptEngine
    By Saranakumardb in forum Qt Programming
    Replies: 8
    Last Post: 31st July 2008, 18:56

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.