QQuickWebEngineProfile#
The QQuickWebEngineProfile
class provides a web engine profile shared by multiple pages. More…
Synopsis#
Properties#
spellCheckEnabled
- Whether the web engine spell checker is enabledspellCheckLanguages
- Languages used by the spell checker
Functions#
def
cachePath
()def
clearHttpCache
()def
cookieStore
()def
downloadPath
()def
httpAcceptLanguage
()def
httpCacheMaximumSize
()def
httpCacheType
()def
httpUserAgent
()def
installUrlSchemeHandler
(scheme, arg__2)def
isOffTheRecord
()def
isPushServiceEnabled
()def
isSpellCheckEnabled
()def
persistentCookiesPolicy
()def
persistentStoragePath
()def
removeAllUrlSchemeHandlers
()def
removeUrlScheme
(scheme)def
removeUrlSchemeHandler
(arg__1)def
setCachePath
(path)def
setDownloadPath
(path)def
setHttpAcceptLanguage
(httpAcceptLanguage)def
setHttpCacheMaximumSize
(maxSize)def
setHttpCacheType
(arg__1)def
setHttpUserAgent
(userAgent)def
setOffTheRecord
(offTheRecord)def
setPersistentCookiesPolicy
(arg__1)def
setPersistentStoragePath
(path)def
setPushServiceEnabled
(enable)def
setSpellCheckEnabled
(enabled)def
setSpellCheckLanguages
(languages)def
setStorageName
(name)def
setUrlRequestInterceptor
(interceptor)def
spellCheckLanguages
()def
storageName
()def
urlSchemeHandler
(arg__1)
Signals#
def
cachePathChanged
()def
downloadPathChanged
()def
httpAcceptLanguageChanged
()def
httpCacheMaximumSizeChanged
()def
httpCacheTypeChanged
()def
httpUserAgentChanged
()def
offTheRecordChanged
()def
persistentStoragePathChanged
()def
presentNotification
(notification)def
pushServiceEnabledChanged
()def
spellCheckEnabledChanged
()def
spellCheckLanguagesChanged
()def
storageNameChanged
()
Static functions#
def
defaultProfile
()
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
Detailed Description#
A web engine profile contains settings, scripts, persistent cookie policy, and the list of visited links shared by all web engine pages 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.
The default profile can be accessed by defaultProfile()
. It is a built-in profile that all web pages not specifically created with another profile belong to.
A WebEngineProfile instance can be created and accessed from C++ through the QQuickWebEngineProfile
class, which exposes further functionality in C++. This allows Qt Quick applications to intercept URL requests (QQuickWebEngineProfile::setRequestInterceptor), or register custom URL schemes ( installUrlSchemeHandler
).
Spellchecking HTML form fields can be enabled per profile by setting the spellCheckEnabled
property and the current languages used for spellchecking can be set by using the spellCheckLanguages
property.
- class PySide6.QtWebEngineQuick.QQuickWebEngineProfile([parent=None])#
- Parameters:
parent –
PySide6.QtCore.QObject
Constructs a new profile with the parent parent
.
Note
Properties can be used directly when from __feature__ import true_property
is used or via accessor functions otherwise.
- property PᅟySide6.QtWebEngineQuick.QQuickWebEngineProfile.cachePath: str#
The path to the location where the profile’s caches are stored, in particular the HTTP cache.
By default, the caches are stored below QStandardPaths::writableLocation(QStandardPaths::CacheLocation) in a directory named using storageName
.
- Access functions:
cachePath
()setCachePath
(path)Signal
cachePathChanged
()
- property PᅟySide6.QtWebEngineQuick.QQuickWebEngineProfile.downloadPath: str#
The path to the location where the downloaded files are stored.
Overrides the default path used for download location, setting it to path
.
If set to an empty string, the default path is restored.
Note
By default, the download path is QStandardPaths::DownloadLocation.
- Access functions:
downloadPath
()setDownloadPath
(path)Signal
downloadPathChanged
()
- property PᅟySide6.QtWebEngineQuick.QQuickWebEngineProfile.httpAcceptLanguage: str#
The value of the Accept-Language HTTP request-header field.
- Access functions:
setHttpAcceptLanguage
(httpAcceptLanguage)Signal
httpAcceptLanguageChanged
()
- property PᅟySide6.QtWebEngineQuick.QQuickWebEngineProfile.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
- Access functions:
setHttpCacheMaximumSize
(maxSize)Signal
httpCacheMaximumSizeChanged
()
- property PᅟySide6.QtWebEngineQuick.QQuickWebEngineProfile.httpCacheType: HttpCacheType#
This enumeration describes the type of the HTTP cache.
If the profile is off-the-record or has no storageName
set, MemoryHttpCache
is returned.
- Access functions:
setHttpCacheType
(arg__1)Signal
httpCacheTypeChanged
()
- property PᅟySide6.QtWebEngineQuick.QQuickWebEngineProfile.httpUserAgent: str#
The user-agent string sent with HTTP to identify the browser.
- Access functions:
setHttpUserAgent
(userAgent)Signal
httpUserAgentChanged
()
- property PᅟySide6.QtWebEngineQuick.QQuickWebEngineProfile.isPushServiceEnabled: bool#
Whether the push messaging service is enabled.
Note
By default the push messaging service is disabled.
Note
Qt WebEngine uses the Firebase Cloud Messaging (FCM) as a browser push service. Therefore, all push messages will go through the Google push service and its respective servers.
- Access functions:
setPushServiceEnabled
(enable)Signal
pushServiceEnabledChanged
()
- property PᅟySide6.QtWebEngineQuick.QQuickWebEngineProfile.offTheRecord: bool#
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. Profile is off-the-record by default.
- Access functions:
setOffTheRecord
(offTheRecord)Signal
offTheRecordChanged
()
- property PᅟySide6.QtWebEngineQuick.QQuickWebEngineProfile.persistentCookiesPolicy: PersistentCookiesPolicy#
This enumeration describes the policy of cookie persistency. If the profile is off-the-record, NoPersistentCookies
is returned.
- Access functions:
setPersistentCookiesPolicy
(arg__1)Signal
persistentCookiesPolicyChanged
()
- property PᅟySide6.QtWebEngineQuick.QQuickWebEngineProfile.persistentStoragePath: str#
The path to the location where the persistent data for the browser and web content are stored. Persistent data includes persistent cookies, HTML5 local storage, and visited links.
By default, the storage is located below QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) in a directory named using storageName
.
- Access functions:
setPersistentStoragePath
(path)Signal
persistentStoragePathChanged
()
- property PᅟySide6.QtWebEngineQuick.QQuickWebEngineProfile.spellCheckEnabled: bool#
This property holds whether the web engine spell checker is enabled..
- Access functions:
setSpellCheckEnabled
(enabled)Signal
spellCheckEnabledChanged
()
- property PᅟySide6.QtWebEngineQuick.QQuickWebEngineProfile.spellCheckLanguages: list of strings#
This property holds The languages used by the spell checker..
- Access functions:
setSpellCheckLanguages
(languages)Signal
spellCheckLanguagesChanged
()
- property PᅟySide6.QtWebEngineQuick.QQuickWebEngineProfile.storageName: str#
The storage name that is used to create separate subdirectories for each profile that uses the disk for storing persistent data and cache.
See also
- Access functions:
storageName
()setStorageName
(name)Signal
storageNameChanged
()
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.HttpCacheType#
This enum describes the HTTP cache type:
Constant
Description
QQuickWebEngineProfile.MemoryHttpCache
Use an in-memory cache. This is the default if
off-the-record
is set.QQuickWebEngineProfile.DiskHttpCache
Use a disk cache. This is the default if
off-the-record
is not set. Falls back toMemoryHttpCache
ifoff-the-record
is set.QQuickWebEngineProfile.NoCache
Disable both in-memory and disk caching. (Added in Qt 5.7)
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.PersistentCookiesPolicy#
This enum describes policy for cookie persistency:
Constant
Description
QQuickWebEngineProfile.NoPersistentCookies
Both session and persistent cookies are stored in memory. This is the only setting possible if
off-the-record
is set or no persistent data path is available.QQuickWebEngineProfile.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.
QQuickWebEngineProfile.ForcePersistentCookies
Both session and persistent cookies are saved to and restored from disk.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.cachePath()#
- Return type:
str
See also
Getter of property cachePath
.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.cachePathChanged()#
Notification signal of property cachePath
.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.clearHttpCache()#
Removes the profile’s cache entries.
See also
clearHttpCache
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.cookieStore()#
- Return type:
Returns the cookie store for this profile.
- static PySide6.QtWebEngineQuick.QQuickWebEngineProfile.defaultProfile()#
- Return type:
Returns the default profile.
The default profile is off-the-record.
See also
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.downloadPath()#
- Return type:
str
See also
Getter of property downloadPath
.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.downloadPathChanged()#
Notification signal of property downloadPath
.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.httpAcceptLanguage()#
- Return type:
str
See also
Getter of property httpAcceptLanguage
.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.httpAcceptLanguageChanged()#
Notification signal of property httpAcceptLanguage
.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.httpCacheMaximumSize()#
- Return type:
int
See also
Getter of property httpCacheMaximumSize
.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.httpCacheMaximumSizeChanged()#
Notification signal of property httpCacheMaximumSize
.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.httpCacheType()#
- Return type:
See also
Getter of property httpCacheType
.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.httpCacheTypeChanged()#
Notification signal of property httpCacheType
.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.httpUserAgent()#
- Return type:
str
See also
Getter of property httpUserAgent
.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.httpUserAgentChanged()#
Notification signal of property httpUserAgent
.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.installUrlSchemeHandler(scheme, arg__2)#
- Parameters:
scheme –
PySide6.QtCore.QByteArray
Registers a handler handler
for custom URL scheme scheme
in the profile.
It is necessary to first register the scheme with registerScheme
at application startup.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.isOffTheRecord()#
- Return type:
bool
Getter of property offTheRecord
.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.isPushServiceEnabled()#
- Return type:
bool
Getter of property isPushServiceEnabled
.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.isSpellCheckEnabled()#
- Return type:
bool
Getter of property spellCheckEnabled
.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.offTheRecordChanged()#
Notification signal of property offTheRecord
.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.persistentCookiesPolicy()#
- Return type:
See also
Getter of property persistentCookiesPolicy
.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.persistentCookiesPolicyChanged()#
Notification signal of property persistentCookiesPolicy
.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.persistentStoragePath()#
- Return type:
str
See also
Getter of property persistentStoragePath
.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.persistentStoragePathChanged()#
Notification signal of property persistentStoragePath
.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.presentNotification(notification)#
- Parameters:
notification –
PySide6.QtWebEngineCore.QWebEngineNotification
This signal is emitted whenever there is a newly created user notification. The notification
argument holds the QWebEngineNotification
instance to query data and interact with.
See also
presentNotification
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.pushServiceEnabledChanged()#
Notification signal of property isPushServiceEnabled
.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.removeAllUrlSchemeHandlers()#
Removes all custom URL scheme handlers installed in the profile.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.removeUrlScheme(scheme)#
- Parameters:
scheme –
PySide6.QtCore.QByteArray
Removes the custom URL scheme scheme
from the profile.
See also
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.removeUrlSchemeHandler(arg__1)#
- Parameters:
Removes the custom URL scheme handler handler
from the profile.
See also
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.setCachePath(path)#
- Parameters:
path – str
See also
Setter of property cachePath
.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.setDownloadPath(path)#
- Parameters:
path – str
See also
Setter of property downloadPath
.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.setHttpAcceptLanguage(httpAcceptLanguage)#
- Parameters:
httpAcceptLanguage – str
See also
Setter of property httpAcceptLanguage
.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.setHttpCacheMaximumSize(maxSize)#
- Parameters:
maxSize – int
See also
Setter of property httpCacheMaximumSize
.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.setHttpCacheType(arg__1)#
- Parameters:
arg__1 –
HttpCacheType
See also
Setter of property httpCacheType
.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.setHttpUserAgent(userAgent)#
- Parameters:
userAgent – str
See also
Setter of property httpUserAgent
.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.setOffTheRecord(offTheRecord)#
- Parameters:
offTheRecord – bool
See also
Setter of property offTheRecord
.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.setPersistentCookiesPolicy(arg__1)#
- Parameters:
arg__1 –
PersistentCookiesPolicy
See also
Setter of property persistentCookiesPolicy
.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.setPersistentStoragePath(path)#
- Parameters:
path – str
See also
Setter of property persistentStoragePath
.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.setPushServiceEnabled(enable)#
- Parameters:
enable – bool
See also
Setter of property isPushServiceEnabled
.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.setSpellCheckEnabled(enabled)#
- Parameters:
enabled – bool
See also
Setter of property spellCheckEnabled
.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.setSpellCheckLanguages(languages)#
- Parameters:
languages – list of strings
See also
Setter of property spellCheckLanguages
.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.setStorageName(name)#
- Parameters:
name – str
See also
Setter of property storageName
.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.setUrlRequestInterceptor(interceptor)#
- Parameters:
interceptor –
PySide6.QtWebEngineCore.QWebEngineUrlRequestInterceptor
Registers a request interceptor singleton interceptor
to intercept URL requests.
The profile does not take ownership of the pointer.
See also
QWebEngineUrlRequestInfo
QWebEngineUrlRequestInterceptor
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.spellCheckEnabledChanged()#
Notification signal of property spellCheckEnabled
.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.spellCheckLanguages()#
- Return type:
list of strings
Returns the list of languages used by the spell checker.
See also
Getter of property spellCheckLanguages
.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.spellCheckLanguagesChanged()#
Notification signal of property spellCheckLanguages
.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.storageName()#
- Return type:
str
See also
Getter of property storageName
.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.storageNameChanged()#
Notification signal of property storageName
.
- PySide6.QtWebEngineQuick.QQuickWebEngineProfile.urlSchemeHandler(arg__1)#
- Parameters:
arg__1 –
PySide6.QtCore.QByteArray
- Return type:
Returns the custom URL scheme handler register for the URL scheme scheme
.