QWebEngineCookieStore Class
The QWebEngineCookieStore class provides access to Chromium's cookies. 更多...
头文件: | #include <QWebEngineCookieStore> |
开始支持版本: | Qt 5.6 |
基类: | QObject |
公有函数
virtual | ~QWebEngineCookieStore() |
void | deleteAllCookies() |
void | deleteCookie(const QNetworkCookie &cookie, const QUrl &origin = QUrl()) |
void | deleteSessionCookies() |
void | loadAllCookies() |
void | setCookie(const QNetworkCookie &cookie, const QUrl &origin = QUrl()) |
- 32 个公有函数继承自 QObject
信号
void | cookieAdded(const QNetworkCookie &cookie) |
void | cookieRemoved(const QNetworkCookie &cookie) |
- 2 个信号继承自 QObject
其他继承的成员
- 1 个属性继承自 QObject
- 1 个公有槽函数继承自 QObject
- 1 个公有变量继承自 QObject
- 10 个静态公有成员继承自 QObject
- 9 个受保护的函数继承自 QObject
- 2 个受保护的变量继承自 QObject
详细描述
The QWebEngineCookieStore class provides access to Chromium's cookies.
The class allows to access HTTP cookies of Chromium for a specific profile. It can be used to synchronize cookies of Chromium and the QNetworkAccessManager, as well as to set, delete, and intercept cookies during navigation. Because cookie operations are asynchronous, the user can choose to provide a callback function to get notified about the success of the operation. The signal handlers for removal and addition should not be used to execute heavy tasks, because they might block the IO thread in case of a blocking connection.
Use QWebEngineProfile::cookieStore() and QQuickWebEngineProfile::cookieStore() to access the cookie store object for a specific profile.
成员函数
[virtual]
QWebEngineCookieStore::~QWebEngineCookieStore()
Destroys this QWebEngineCookieStore object.
[signal]
void QWebEngineCookieStore::cookieAdded(const QNetworkCookie &cookie)
This signal is emitted whenever a new cookie is added to the cookie store.
[signal]
void QWebEngineCookieStore::cookieRemoved(const QNetworkCookie &cookie)
This signal is emitted whenever a cookie is deleted from the cookie store.
void QWebEngineCookieStore::deleteAllCookies()
Deletes all the cookies in the cookie store.
Note: This operation is asynchronous.
参见 loadAllCookies().
void QWebEngineCookieStore::deleteCookie(const QNetworkCookie &cookie, const QUrl &origin = QUrl())
Deletes cookie from the cookie store. It is possible to provide an optional origin URL argument to limit the scope of the cookie to be deleted.
Note: This operation is asynchronous.
void QWebEngineCookieStore::deleteSessionCookies()
Deletes all the session cookies in the cookie store. Session cookies do not have an expiration date assigned to them.
Note: This operation is asynchronous.
参见 loadAllCookies().
void QWebEngineCookieStore::loadAllCookies()
Loads all the cookies into the cookie store. The cookieAdded() signal is emitted on every loaded cookie. Cookies are loaded automatically when the store gets initialized, which in most cases happens on loading the first URL. However, calling this function is useful if cookies should be listed before entering the web content.
Note: This operation is asynchronous.
void QWebEngineCookieStore::setCookie(const QNetworkCookie &cookie, const QUrl &origin = QUrl())
Adds cookie to the cookie store. It is possible to provide an optional origin URL argument to limit the scope of the cookie. The provided URL should also include the scheme.
Note: This operation is asynchronous.