[Interest] How to reset QML WebView?

Jan Kundrát jkt at flaska.net
Tue Jun 3 16:55:24 CEST 2014


On Monday, 2 June 2014 19:59:11 CEST, Николай Шатохин wrote:
> if(_socialWindow == NULL)

Please note that identifiers that start with an underscore are reserved in 
C++. You are not supposed to use them for your own purposes in your code.

>     _socialWindow->setSource(QUrl(source)); // source is a patch to QML file

How does that QML file look like?

> And clearing cookies manually
> 
> _socialWindow->engine()->networkAccessManager()->cookieJar()->setCookieJar(new
> QNetworkCookieJar());

This is Qt5, and in Qt5, the QML WebView does not use the 
QNetworkAccessManager for network IO anymore. The QNAM you access here is 
only used for the QML engine's own purposes when it fetches QML files over 
the network. It has absolutely no effect on how QtWebKit (and the QML 
WebView) accesses web pages.

> _socialWindow->engine()->clearComponentCache();

QML component cache has nothing to do with WebView's webkit cache.

You should follow the advice given by Olivier Tilloy. If the private 
browsing mode really doesn't work, there's quite some breakage.

With kind regards,
Jan

-- 
Trojitá, a fast Qt IMAP e-mail client -- http://trojita.flaska.net/



More information about the Interest mailing list