PySide6.QtWebEngineCore.QWebEngineProfileBuilder¶
- class QWebEngineProfileBuilder¶
The
QWebEngineProfileBuilder
class provides a way to constructQWebEngineProfile
. More…Added in version 6.9.
Synopsis¶
Methods¶
Static functions¶
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
QWebEngineProfileBuilder
creates an instance ofQWebEngineProfile
class. Some profile’s properties have to be initialized in one call and should not be modified during profile lifetime. The web engine profile builder simply guards that.- __init__()¶
Creates an off-the-record profile with the parent object
parent
that leaves no record on the local machine and has no persistent data or cache. This will force cookies, persistent data and HTTP cache to be stored in memory- createProfile(storageName[, parent=None])¶
- Parameters:
storageName – str
parent –
QObject
- Return type:
Constructs a profile with the storage name
storageName
and parentparent
.The storage name is used to give each disk-based profile, a separate subdirectory for persistent data and cache. The storage location must be unique during application life time. It is up to the user to prevent the creation of profiles with same storage’s location, which can lead to corrupted browser cache.
A disk-based
QWebEngineProfile
should be destroyed before the application exit, otherwise the cache and persistent data may not be fully flushed to disk.Note
When creating a disk-based profile, if the data path is already in use by another profile, the function will return a null pointer.
See also
- setCachePath(path)¶
- Parameters:
path – str
- Return type:
Sets the path used for the cache to
path
.By default, this is below StandardPaths::CacheLocation in a QtWebengine/StorageName specific subdirectory.
Note
Use QStandardPaths::writableLocation(QStandardPaths::CacheLocation) to obtain the QStandardPaths::CacheLocation path.
See also
- setHttpCacheMaximumSize(maxSizeInBytes)¶
- Parameters:
maxSizeInBytes – int
- Return type:
Sets the maximum size of the HTTP cache to
maxSizeInBytes
bytes.Setting it to
0
means the size will be controlled automatically by QtWebEngine .See also
- setHttpCacheType(httpCacheType)¶
- Parameters:
httpCacheType –
HttpCacheType
- Return type:
Sets the HTTP cache type to
httpCacheType
.See also
- setPersistentCookiesPolicy(persistentCookiesPolicy)¶
- Parameters:
persistentCookiesPolicy –
PersistentCookiesPolicy
- Return type:
Sets the policy for persistent cookies to
persistentCookiePolicy
.See also
- setPersistentPermissionsPolicy(persistentPermissionPolicy)¶
- Parameters:
persistentPermissionPolicy –
PersistentPermissionsPolicy
- Return type:
Sets the policy for persistent permissions to
persistentPermissionPolicy
.See also
- setPersistentStoragePath(path)¶
- Parameters:
path – str
- Return type:
Sets the path used to store persistent data for the browser and web content to
path
. Persistent data includes persistent cookies, HTML5 local storage, and visited links.By default, this is below QStandardPaths::DataLocation in a QtWebengine/StorageName specific subdirectory.
Note
Use QStandardPaths::writableLocation(QStandardPaths::DataLocation) to obtain the QStandardPaths::DataLocation path.