[webkit-qt] jsMath behavior different on win vs. linux

Carter, Nathan NCARTER at bentley.edu
Mon Apr 12 09:50:03 PDT 2010


Well, this is a helpful list!  Thanks for the discussion.  It's a lot more fun than programming alone.

> Prepending file:// to JSMATH_PATH makes the script load for me at least.
> evaluateJavaScript() doesn't know how to return JS object references; 
> you get an invalid variant. evaluating "jsMath.toString()" proves that 
> the object is loaded (returns "[object Object]").

Well, the jsMath.toString() tip is obviously crucial, but the other suggestion doesn't seem to make a difference.  Specifically, I took the code from my earlier email and made these modifications.

>> #define JSMATH_PATH "/Users/nathan/download/jsMath-3.6c"

#define JSMATH_PATH "file:///Users/nathan/download/jsMath-3.6c"

>>    qDebug() << wv.page()->mainFrame()->evaluateJavaScript( "jsMath" ).toString();

   qDebug() << wv.page()->mainFrame()->evaluateJavaScript( "jsMath.toString()" ).toString();

Same results as before; the value dumped after app.exec() is "".

Just in case the web view was shutting down at that time and thus corrupting the result, I created a timer that fires every second and hits a slot that does the qDebug() dumping, and I get one "" every second.

(And still jsMath is not rendering the math, of course.)

That brings this little example up to three files, which I could post (or use pastebin or something) if it would be helpful.

Nathan



More information about the webkit-qt mailing list