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
setAttribute() function. The
WebAttribute enum further describes each attribute.
QWebEnginePage object has its own
QWebEngineSettings object, which configures the settings for that page. If a setting is not configured for a web engine page, it is looked up in the settings of the profile the page belongs to.
- class PySide6.QtWebEngineCore.QWebEngineSettings#
This enum describes the generic font families defined by CSS 2. For more information see the CSS standard .
(added in Qt 5.7, deprecated Qt 6.4)
This enum type specifies settings for web pages:
Automatically dowloads images for web pages. When this setting is disabled, images are loaded from the cache. Enabled by default.
MainWorld. Enabled by default.
Includes hyperlinks in the keyboard focus chain. Enabled by default.
Enables support for the HTML 5 local storage feature. Enabled by default.
Allows local origin documents to access remote resources that would normally be blocked. Disabled by default. Note DnsPrefetchEnabled below operates independently of this setting, and can if enabled, cause remote accesses from local content.
Obsolete and has no effect.
Enables the Spatial Navigation feature, which means the ability to navigate between focusable elements, such as hyperlinks and form controls, on a web page by using the Left, Right, Up and Down arrow keys. For example, if a user presses the Right key, heuristics determine whether there is an element they might be trying to reach towards the right and which element they probably want. Disabled by default.
Allows locally loaded documents to access other local URLs. Disabling this makes QtWebEngine behave more like Chrome and Firefox does by default. Enabled by default.
Enables support for the
pingattribute for hyperlinks. Disabled by default.
Enables animated scrolling. Disabled by default.
Enables displaying the built-in error pages of Chromium. Enabled by default.
Enables support for Pepper plugins, such as the Flash player. Disabled by default. See also Pepper Plugin API . (Added in Qt 5.6)
Enables fullscreen support in an application. Disabled by default. (Added in Qt 5.6)
Enables screen capture in an application. Disabled by default. (Added in Qt 5.7)
Enables support for HTML 5 WebGL. Enabled by default if available. (Added in Qt 5.7)
Specifies whether the HTML5 2D canvas should be a OpenGL framebuffer. This makes many painting operations faster, but slows down pixel access. Enabled by default if available. (Added in Qt 5.7)
Automatically downloads icons for web pages. Enabled by default. (Added in Qt 5.7)
Enables support for touch icons and precomposed touch icons Disabled by default. (Added in Qt 5.7)
Gives focus to the view associated with the page, whenever a navigation operation occurs (load, stop, reload, reload and bypass cache, forward, backward, set content, and so on). Disabled by default. (Added in Qt 5.8)
Turns on printing of CSS backgrounds when printing a web page. Enabled by default. (Added in Qt 5.8)
Since Qt 5.7, only secure origins such as HTTPS have been able to request Geolocation features. This provides an override to allow non secure origins to access Geolocation again. Disabled by default. (Added in Qt 5.9)
Shows scroll bars. Enabled by default. (Added in Qt 5.10)
Inhibits playback of media content until the user interacts with the page. By default, WebEngine uses Chromium settings, as described in Autoplay Policy Changes . This is similar to how Chrome on Android behaves, while the default behavior when it is disabled is similar to Chrome on desktops. To overwrite the default behavior, disable this setting. (Added in Qt 5.11)
Limits WebRTC to public IP addresses only. When disabled WebRTC may also use local network IP addresses, but remote hosts can also see your local network IP address. Disabled by default. (Added in Qt 5.11)
Specifies whether WebEngine will try to pre-fetch DNS entries to speed up browsing. Disabled by default. (Added in Qt 5.12)
Specifies that PDF documents will be opened in the internal PDF viewer instead of being downloaded. Enabled by default. (Added in Qt 5.13)
Specifies that navigations can be triggered by dropping URLs on the view. Enabled by default. (Added in Qt 6.4)
Specifies that reading from all canvas elements is enabled. This setting will have impact on all HTML5 canvas elements irrespective of origin, and can be disabled to prevent canvas fingerprinting. Enabled by default. (Added in Qt 6.6)
This enum describes the font sizes configurable through
The hard minimum font size.
The minimum logical font size that is applied when zooming out.
The default font size for regular text.
The default font size for fixed-pitch text.
This enum describes how navigation requests to URLs with unknown schemes are handled.
Disallows all navigation requests to URLs with unknown schemes.
Allows all navigation requests to URLs with unknown schemes.
- Return type:
Returns the default text encoding.
- Return type:
Returns the actual font family for the specified generic font family,
- Return type:
Returns the default font size for
type in pixels.
Resets the setting of
attribute to the value specified in the profile that the page belongs to.
Resets the actual font family specified by
which to the one specified in the profile that the page belongs to.
Resets the font size for
type to the size specified in the profile that the page belongs to.
Removes the policy for handling navigation requests to URLs with unknown schemes.
- PySide6.QtWebEngineCore.QWebEngineSettings.setAttribute(attr, on)#
on – bool
Enables or disables the specified
attribute feature depending on the value of
encoding – str
Specifies the default text encoding system.
The value of
encoding must be a string describing an encoding such as “utf-8” or “iso-8859-1”. If left empty, a default value will be used. For a more extensive list of encoding names see QTextCodec.
- PySide6.QtWebEngineCore.QWebEngineSettings.setFontFamily(which, family)#
family – str
- PySide6.QtWebEngineCore.QWebEngineSettings.setFontSize(type, size)#
size – int
Sets the font size for
size in pixels.
Sets the policy for handling navigation requests to URLs with unknown schemes to
policy. Default is
- Return type:
attribute is enabled; otherwise returns
- Return type:
Returns the currently selected policy for handling navigation requests to URLs with unknown schemes. Default is