PyQt - QWebView Enables Application Cache?

554 Views Asked by At

I wonder how to enable application cache in a Qt program written in python?

1

There are 1 best solutions below

0
ch271828n On BEST ANSWER

Use this code: Remember to change the '__your_path__' to a path you like to store the data.

settings = QWebSettings.globalSettings()
settings.setAttribute(QWebSettings.LocalStorageEnabled, True)
settings.setAttribute(QWebSettings.OfflineWebApplicationCacheEnabled, True)
settings.enablePersistentStorage('__your_path__')

If you only uses OfflineWebApplicationCacheEnabled, it will only be of no use! Remember to use enablePersistentStorage also.