0

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

ch271828n
  • 15,854
  • 5
  • 53
  • 88

1 Answers1

0

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.

ch271828n
  • 15,854
  • 5
  • 53
  • 88