3

I need to store cookies persistently in an application that uses QWebKit. I understand that I have to create a subclass of QNetworkCookieJar and attach it to a QNetworkAccessManager. But how do I attach this QNetworkAccessManager to my QWebView or get the QNetworkAccessManager used by it?

I use Python 3 and PyQt if that is important.

Nova
  • 2,623
  • 4
  • 26
  • 45

1 Answers1

4

You can get/set the cookie jar through QWebView.page().networkAccessManager().cookieJar()/setCookieJar().

The Browser demo included with Qt (in C++) shows how to read and write cookies to disk.

alexisdm
  • 29,448
  • 6
  • 64
  • 99