0
QObject::connect(webview->page()->mainFrame(), SIGNAL(initialLayoutCompleted()), webview->page()->mainFrame(), SLOT(evaluateJavaScript("alert(); null")));
我的代碼可以編譯,但不會發生任何事情。 evaluateJavascript不是問題,因爲我已經在獨立測試並且工作正常。信號既不是問題,因爲我已經完成:如何在QWebFrame中注入Javascript?
QObject::connect(webview->page()->mainFrame(), SIGNAL(initialLayoutCompleted()), webview, SLOT(close())));
並且該應用程序已關閉正常。我認爲這個問題與「webview-> page-> mainFrame()」部分有關。
謝謝。
謝謝!有效 – user2047330