简体   繁体   English

Qt 5:在QtWebEngine中访问Cookie

[英]Qt 5: Access Cookies in QtWebEngine

Is it possible to access the QNetworkCookieJar in QtWebEngine like you could before with QtWebKit ? 是否可以像以前使用QtWebKit一样在QtWebEngine访问QNetworkCookieJar I can't find it anywhere in the documentation... 我在文档的任何地方都找不到它...

从Qt 5.6开始,您可以使用QWebEngineCookieStore类

QNetworkCookie is available for QtWebEngine, but only through the old QNetworkAccessManager as QtWebEngine is using its own HTTP implementation. QNetworkCookie可用于QtWebEngine,但只能通过旧版QNetworkAccessManager使用,因为QtWebEngine使用其自己的HTTP实现。 You can notice this while reading one of the examples : 您可以在阅读以下示例之一时注意到这一点:

contains(DEFINES, QWEBENGINEPAGE_SETNETWORKACCESSMANAGER) {
    HEADERS += cookiejar.h networkaccessmanager.h
    SOURCES += cookiejar.cpp networkaccessmanager.cpp
}

Please refer to the following example for details: 有关详细信息,请参见以下示例:

WebEngine Tab Browser Example WebEngine选项卡浏览器示例

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM