This bug report originated from issue QTBUG-3019 http://bugreports.qt.nokia.com/browse/QTBUG-3019 --- Description --- EvaluateJavaScript is supposed to provide the return value of the script. It's always null. http://doc.trolltech.com/4.4/qwebframe.html#evaluateJavaScript int main(int argc, char *argv[]) { QApplication app(argc, argv); QWebView *view = new QWebView; view->setHtml("<html><body>Hello world</body></html>"); view->show(); QEventLoop l; QTimer::singleShot(2000, &l, SLOT(quit())); l.exec(); qDebug() << "evaluating javascript"; QVariant retval = view->page()->mainFrame()->evaluateJavaScript("alert('hi'); return true;"); qDebug() << retval; return app.exec(); }
In example JavaScript code: "alert('hi'); return true;" throw an exception. SyntaxError: Invalid return statement. Return key word can't be used outside functions body. Should be: "alert('hi'); a = true;" or just "alert('hi'); true;" The test case is wrong. Please close the bug.
(In reply to comment #1) > The test case is wrong. Please close the bug. Closing.