[webkit-qt] [QtWebkitBridge] local function variables not accessible!

sunny shah sunny.cpp at gmail.com
Wed Sep 14 13:33:55 PDT 2011


Hi,

Suppose, below is my JS Code in html file

function analyzeImages() {
  var strHello = "Hello World"
  imageAnalyzer.startAnalysis();
}

Now, Here is a startAnalyzer slot code in C++
void ImageAnalyzer::startAnalysis() {
// Below code works ( Gives message box )
((MainWin*)parent())->page()->mainFrame()->evaluateJavaScript("alert('Qt is
good'); ");
// Now below line does not work.
((MainWin*)parent())->page()->mainFrame()->evaluateJavaScript("alert(strHello);
");
 // do something
}

1). Any idea, how to make it work?
2). If it is not supported by QtWebkitBridge, then can you please tell me
what was the reason behind it?
3). It is very important for us to make this work, can you please tell me
how to do this?

Thanks,
 Sunny.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-qt/attachments/20110915/2ad00eec/attachment.html>


More information about the webkit-qt mailing list