WebEngineProfile QML Type | Qt WebEngine 5.15.19 (original) (raw)

Contains settings, scripts, and visited links common to multiple web engine views. More...

Properties

Signals

Methods

Detailed Description

WebEngineProfile contains settings, scripts, and the list of visited links shared by all views that belong to the profile.

Information about visited links is stored together with persistent cookies and other persistent data in a storage determined by the storageName property. Persistent data is stored in a subdirectory determined by the persistentStoragePath property and the cache in a subdirectory determined by the cachePath property. The httpCacheType property describes the type of the cache: in-memory or on-disk. If only the storageName property is set, the other values are generated automatically based on it. If you specify any of the values manually, you should do it before creating any pages that belong to the profile.

Profiles can be used to isolate pages from each other. A typical use case is a dedicated off-the-record profile for a private browsing mode. An off-the-record profile forces cookies, the HTTP cache, and other normally persistent data to be stored only in memory. The offTheRecord property holds whether a profile is off-the-record.

Each web engine view has an associated profile. Views that do not have a specific profile set share a common default one.

Property Documentation

The path to the location where the downloaded files are stored.

Overrides the default path used for download location.

If set to an empty string, the default path is restored.

This property was introduced in QtWebEngine 1.9.

The value of the Accept-Language HTTP request-header field.

This property was introduced in QtWebEngine 1.2.

httpCacheMaximumSize : int

The maximum size of the HTTP cache. If 0, the size will be controlled automatically by QtWebEngine. The default value is 0.

See also httpCacheType.

This enumeration describes the type of the HTTP cache:

Constant Description
WebEngineProfile.MemoryHttpCache Uses an in-memory cache. This is the only setting possible if offTheRecord is set or no persistentStoragePath is available.
WebEngineProfile.DiskHttpCache Uses a disk cache. This is the default value.
WebEngineProfile.NoCache Disables caching. (Added in 5.7)

The user-agent string sent with HTTP to identify the browser.

Note: On Windows 8.1 and newer, the default user agent will always report "Windows NT 6.2" (Windows 8), unless the application does contain a manifest that declares newer Windows versions as supported.

Whether the web engine profile is off-the-record. An off-the-record profile forces cookies, the HTTP cache, and other normally persistent data to be stored only in memory.

This enumeration describes the policy of cookie persistency:

Constant Description
WebEngineProfile.NoPersistentCookies Both session and persistent cookies are stored in memory. This is the only setting possible if offTheRecord is set or no persistentStoragePath is available.
WebEngineProfile.AllowPersistentCookies Cookies marked persistent are saved to and restored from disk, whereas session cookies are only stored to disk for crash recovery. This is the default setting.
WebEngineProfile.ForcePersistentCookies Both session and persistent cookies are saved to and restored from disk.

persistentStoragePath : string

This property holds whether the web engine spell checker is enabled.

This property was introduced in QtWebEngine 1.4.

This property holds the list of languages used by the spell checker. Each language should match the name of the .bdic dictionary. For example, the language en-US will load the en-US.bdic dictionary file.

See the Spellchecker feature documentation for how dictionary files are searched.

For more information about how to compile .bdic dictionaries, see the Spellchecker Example.

This property was introduced in QtWebEngine 1.4.

Returns the collection of WebEngineScripts that are injected into all pages that share this profile.

This property was introduced in Qt 1.5.

See also WebEngineScript.

Signal Documentation

This signal is emitted whenever downloading stops, because it finished successfully, was cancelled, or was interrupted (for example, because connectivity was lost). The download argument holds the state of the finished download instance.

Note: The corresponding handler is onDownloadFinished.

This signal is emitted whenever a download has been triggered. The download argument holds the state of the download. The download has to be explicitly accepted with WebEngineDownloadItem::accept() or the download will be cancelled by default.

Note: The corresponding handler is onDownloadRequested.

This signal is emitted whenever there is a newly created user notification. The notification argument holds the WebEngineNotification instance to query data and interact with.

Note: The corresponding handler is onPresentNotification.

This signal was introduced in QtWebEngine 1.9.

Method Documentation

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.