PySide6.QtWebView.QWebViewSettings

class QWebViewSettings

Allows configuration of browser properties and attributes.

Details

The QWebViewSettings object 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

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:

Enables or disables the specified attribute feature depending on the value of on.

testAttribute(attribute)
Parameters:

attributeWebAttribute

Return type:

bool

Returns true if attribute is enabled; otherwise returns false.