PySide6.QtWebView.QWebViewSettings¶
- class QWebViewSettings¶
Allows configuration of browser properties and attributes.
Details
The
QWebViewSettingsobject can be used to configure browser properties and generic attributes, such as JavaScript support, file access and local storage features.The default values are left as set by the different platforms.
Added in version 6.11.
Synopsis¶
Methods¶
def
setAttribute()def
testAttribute()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
- class WebAttribute¶
This enum type specifies settings for web pages:
Constant
Description
QWebViewSettings.WebAttribute.WebAttribute.LocalStorageEnabled
Enables support for the HTML 5 local storage feature.
QWebViewSettings.WebAttribute.WebAttribute.JavaScriptEnabled
Enables the running of JavaScript programs.
QWebViewSettings.WebAttribute.WebAttribute.AllowFileAccess
Allows locally loaded documents to access other local URLs.
QWebViewSettings.WebAttribute.WebAttribute.LocalContentCanAccessFileUrls
Enables the WebView to load file URLs.
- setAttribute(attribute, value)¶
- Parameters:
attribute –
WebAttributevalue – bool
Enables or disables the specified
attributefeature depending on the value ofon.- testAttribute(attribute)¶
- Parameters:
attribute –
WebAttribute- Return type:
bool
Returns
trueifattributeis enabled; otherwise returnsfalse.