标签:style blog class code c java
解决它们之间的通信问题,需要在mainwindow中添加
1
2
3
4
5
6
7
8 |
ui->webView->settings()->setAttribute(QWebSettings::JavascriptEnabled, true ); connect(ui->webView->page()->mainFrame(),SIGNAL(javaScriptWindowObjectCleared()), this ,SLOT(addJavaScriptObject())); void
MainWindow::addJavaScriptObject() { ui->webView->page()->mainFrame()->addToJavaScriptWindowObject( "MainWindow" , this ); } |
QT 5.1 MainWindow 与 QWebview 如何通信,布布扣,bubuko.com
QT 5.1 MainWindow 与 QWebview 如何通信
标签:style blog class code c java
原文地址:http://www.cnblogs.com/hongweili/p/3732618.html