I wonder how to enable application cache
in a Qt
program written in python?
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.