本文整理汇总了Python中PyQt5.QtWebKit.QWebSettings.setMaximumPagesInCache方法的典型用法代码示例。如果您正苦于以下问题:Python QWebSettings.setMaximumPagesInCache方法的具体用法?Python QWebSettings.setMaximumPagesInCache怎么用?Python QWebSettings.setMaximumPagesInCache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWebKit.QWebSettings
的用法示例。
在下文中一共展示了QWebSettings.setMaximumPagesInCache方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: initUI
# 需要导入模块: from PyQt5.QtWebKit import QWebSettings [as 别名]
# 或者: from PyQt5.QtWebKit.QWebSettings import setMaximumPagesInCache [as 别名]
def initUI(self):
self.setMinimumSize(300, 300)
# self.TextEdit = QtWidgets.QTextEdit(self)
# self.TextEdit.setMinimumSize(300, 300)
# self.TextEdit.setReadOnly(True)
# self.load(QtCore.QUrl('file:///'+os.getcwd()+"/generated_html/index.html"))
QWebSettings.setMaximumPagesInCache(0)
QWebSettings.setObjectCacheCapacities(0, 0, 0)
示例2: __init__
# 需要导入模块: from PyQt5.QtWebKit import QWebSettings [as 别名]
# 或者: from PyQt5.QtWebKit.QWebSettings import setMaximumPagesInCache [as 别名]
def __init__(self, log,
confirm_callback=None,
prompt_callback=None,
user_agent=USER_AGENT,
enable_developer_tools=False,
parent=None):
QWebPage.__init__(self, parent)
self.log = log
self.user_agent = user_agent if user_agent else USER_AGENT
self.confirm_callback = confirm_callback
self.prompt_callback = prompt_callback
self.setForwardUnsupportedContent(True)
self.unsupportedContent.connect(self.on_unsupported_content)
settings = self.settings()
if enable_developer_tools:
settings.setAttribute(QWebSettings.DeveloperExtrasEnabled, True)
QWebSettings.enablePersistentStorage(os.path.join(cache_dir(),
'webkit-persistence'))
QWebSettings.setMaximumPagesInCache(0)
self.bridge_name = 'b' + uuid.uuid4().get_hex()
self.mainFrame().javaScriptWindowObjectCleared.connect(
self.add_window_objects)
self.dom_loaded = False
示例3:
# 需要导入模块: from PyQt5.QtWebKit import QWebSettings [as 别名]
# 或者: from PyQt5.QtWebKit.QWebSettings import setMaximumPagesInCache [as 别名]
#'accelerated-compositing':
# (MapType.attribute, QWebSettings.AcceleratedCompositingEnabled),
#'tiled-backing-store':
# (MapType.attribute, QWebSettings.TiledBackingStoreEnabled),
},
'storage': {
'offline-storage-database':
(MapType.attribute, QWebSettings.OfflineStorageDatabaseEnabled),
'offline-web-application-storage':
(MapType.attribute,
QWebSettings.OfflineWebApplicationCacheEnabled),
'local-storage':
(MapType.attribute, QWebSettings.LocalStorageEnabled),
'maximum-pages-in-cache':
(MapType.static_setter, lambda v:
QWebSettings.setMaximumPagesInCache(v)),
'object-cache-capacities':
(MapType.static_setter, lambda v:
QWebSettings.setObjectCacheCapacities(*v)),
'offline-storage-default-quota':
(MapType.static_setter, lambda v:
QWebSettings.setOfflineStorageDefaultQuota(v)),
'offline-web-application-cache-quota':
(MapType.static_setter, lambda v:
QWebSettings.setOfflineWebApplicationCacheQuota(v)),
},
'general': {
'private-browsing':
(MapType.attribute, QWebSettings.PrivateBrowsingEnabled),
'developer-extras':
(MapType.attribute, QWebSettings.DeveloperExtrasEnabled),