[SOLVED] QtWebKit - handle JavaScript alerts/prompts
-
Is there any way how to handle JavaScript alerts and prompts? In order to show it in custom-styled QMessageBox...
-
Yes, there is such option. You need just to create own WebPage that is derivatived from "QWebPage":http://qt-project.org/doc/qt-4.8/qwebpage.html QWebPage. Then overwrite JavaScript methods and do own handling of alerts, etc ("Alert":http://qt-project.org/doc/qt-4.8/qwebpage.html#javaScriptAlert).
In addition, you will need to tell QWebView to use your implementation of WebPage by calling "setPage()":http://qt-project.org/doc/qt-4.8/qwebview.html#setPage on QWebView.