Results 1 to 2 of 2

Thread: I need to evaluate a piece of JavaScript... (solved)

  1. #1
    Join Date
    Feb 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question I need to evaluate a piece of JavaScript... (solved)

    Hello,

    I have a piece of Javascript code that I would like to evaluate from inside my Qt program.

    I want to pass a QString into a the Javascript function and then get the result stored in a different QString.

    I know there's an evaluateJavaScript function in QWebFrame, but using that doesn't seem right since I would need to pass in the whole script as the argument, concatenated with the call to the function I want to evaluate and the input which needs to be properly escaped (quotation marks, newlines, etc.)

    Is there a better way to do that?

    Thanks!
    Last edited by Alec; 7th February 2010 at 20:11. Reason: Solved.

  2. #2
    Join Date
    Feb 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: I need to evaluate a piece of JavaScript...

    I found a solution with QtScript here:

    http://doc.trolltech.com/4.6/qscriptvalue.html#call

    Sorry for the noise!

Similar Threads

  1. execute a small piece of javascript code ?
    By cornucopia in forum Qt Webkit
    Replies: 2
    Last Post: 28th February 2012, 14:00
  2. will this piece of code related to phonon works?
    By Lakshmi.Bollavaram in forum Installation and Deployment
    Replies: 1
    Last Post: 20th November 2009, 08:57
  3. How to execute a small piece of javascript code ?
    By cornucopia in forum Qt Programming
    Replies: 1
    Last Post: 9th August 2009, 10:03
  4. Javascript
    By ale301168 in forum Qt Programming
    Replies: 0
    Last Post: 6th September 2008, 23:23
  5. term does not evaluate to a function
    By :db:sStrong in forum General Programming
    Replies: 6
    Last Post: 18th April 2007, 10:54

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.