Details
-
Bug
-
Resolution: Moved
-
P2: Important
-
4.4.1
-
None
-
None
Description
HTML code usually hooks JavaScript functions to events emitted by plugin objects using one of the following syntaxes (assuming that the class behind testWidget has a signal "TestSignal(QString)"):
<object id="testWidget" type="testmime" width="500" height="400">
</object>
<script type="text/javascript" language="javascript">
// Netscape style
testWidget.TestSignal = function(s)
{
alert(s);
}
// Internet Explorer style
function testWidget::TestSignal(s)
{
alert(s);
}
</script>
Neither of this works with QtWebKit; the C++ code that wants to hook a signal up with a JavaScript function has to do
webView->page()>mainFrame()>evaluateJavaScript("TestSignal(\"" + s + "\")");
instead.