[Interest] How to reset QML WebView?

Николай Шатохин n.shatokhin at gmail.com
Tue Jun 3 18:03:32 CEST 2014


Looks. Here is the simplest code:
https://www.dropbox.com/s/ctdcgrk0eqgq3a3/webview_test.tar.gz

When you start this app you will see white window. Click on window and you
will see browser with Twitter. Click again and browser will be hide and
destroyed.

So, please login to Twitter, than destroy browser by clicking first window
and then create it again by clicking on first window. You will see that you
left signed in. But I need that browser every time opens without signed
user (even if user checked "Remember me" checkbox). How to do this? How to
reset browser to the initial state?


2014-06-03 17:55 GMT+03:00 Jan Kundrát <jkt at flaska.net>:

> 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/
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140603/3b900b21/attachment.html>


More information about the Interest mailing list