Menu

17 July 2010

How to call javascript from Qt code.

Well here is the trick


void MainWindow::on_pushButton_clicked()

{


QString code = "increment();";

ui->webView->page()->mainFrame()->evaluateJavaScript(code);

}


This will execute the JavaScript code when someone click a push button
Well you need to include a

#include <QWebFrame>


in your header file.

Posted via email from LUG@IITD Community Blog

No comments: