Qt WebEnigeView缓存的清除
QWebEngineProfile* engineProfile = webEngineView->page()->profile();
engineProfile->clearHttpCache();
QWebEngineCookieStore* cookie = engineProfile->cookieStore();
Cookie->deleteAllConkies();
Qstring cacePath = engineProfile->cachePath();
Qdir cachePathDie(cachePath);
If(cachePathDir.exists())
{
bool rlt=cachePathDie.rmdir(cachePath);
If(!rlt)
{
删除缓存目录失败!
}
}
本文介绍如何使用QtWebEngineView的API清除浏览器缓存,包括HTTP缓存、Cookies和缓存路径。通过调用特定的方法,可以实现对QtWebEngineView缓存的有效管理和清理。
5493

被折叠的 条评论
为什么被折叠?



