porting from qtwebkit to qtwebengine

Although this authority document talks about the porting issues arising from transferring from qtwebkit to qtwebengine, there are still a lot more to do to accomplish the porting.

Porting from QWebPage/QWebFrame to QWebEnginePage:

void javaScriptAlert ( QWebFrame * frame, const QString & msg );//QWebPage
void javaScriptAlert ( const QUrl &securityOrigin, const QString & msg );//QWebEnginePage

bool javaScriptConfirm ( QWebFrame * frame, const QString & msg );//QWebPage
bool javaScriptConfirm ( const QUrl &securityOrigin, const QString & msg );//QWebEnginePage

bool javaScriptPrompt ( QWebFrame * frame, const QString & msg, const QString & defaultValue, QString * result );//QWebPage
bool javaScriptPrompt ( const QUrl &securityOrigin, const QString & msg, const QString & defaultValue, QString * result );//QWebEnginePage

//bool shouldInterruptJavaScript (); //removed in QWebEnginePage
//virtual QString userAgentForUrl(const QUrl& url) const;//removed in QWebEnginePage

loadFinished(bool) signal in QWebFrame => loadFinished(bool) in QWebEnginePage

page()->findText("somestring",QWebPage::FindCaseSensitively)

The QNetworkAccessManager class is removed from QtWebEnginePage, which means you cannot intercept the request url by re-implementing the createRequest function of QNetworkAccessManager . QWebEnginePage does not have the setNetworkAccessManager function any more. To intercept a request in QWebEnginePage, you need to get the profile of the webenginepage and call its setRequestInterceptor function to set a request interceptor. In this interceptor, you can re-implement the interceptRequest function to get the url,etc. that is passed as a parameter of this function.  QNetworkAccessManager  was also used to share cookies between web pages. Now you can use QNetworkCookieJar to do the same job.

Did you like this?
Tip admin with Cryptocurrency

Donate Bitcoin to admin

Scan to Donate Bitcoin to admin
Scan the QR code or copy the address below into your wallet to send some bitcoin:

Donate Bitcoin Cash to admin

Scan to Donate Bitcoin Cash to admin
Scan the QR code or copy the address below into your wallet to send bitcoin:

Donate Ethereum to admin

Scan to Donate Ethereum to admin
Scan the QR code or copy the address below into your wallet to send some Ether:

Donate Litecoin to admin

Scan to Donate Litecoin to admin
Scan the QR code or copy the address below into your wallet to send some Litecoin:

Donate Monero to admin

Scan to Donate Monero to admin
Scan the QR code or copy the address below into your wallet to send some Monero:

Donate ZCash to admin

Scan to Donate ZCash to admin
Scan the QR code or copy the address below into your wallet to send some ZCash:
Posted in

Leave a Reply