QWebEngineView widget chache and coockies
-
I try to set QWidget promoted to QWebEngineView to have a chache and accept and store coockies .... I try in these way .... is correct or ui->webW in these way have not storages?
I'm on linux
QWebEngineProfile::defaultProfile()->settings()->setAttribute(QWebEngineSettings::PluginsEnabled, true); QWebEngineProfile::defaultProfile()->settings()->setAttribute(QWebEngineSettings::DnsPrefetchEnabled, true); QWebEngineProfile::defaultProfile()->settings()->setAttribute(QWebEngineSettings::ScreenCaptureEnabled, true); QWebEngineProfile::defaultProfile()->settings()->setAttribute(QWebEngineSettings::PdfViewerEnabled, true); QWebEngineProfile::defaultProfile()->settings()->setAttribute(QWebEngineSettings::JavascriptEnabled, true); QWebEngineProfile::defaultProfile()->settings()->setAttribute(QWebEngineSettings::Accelerated2dCanvasEnabled, true); QWebEngineProfile::defaultProfile()->settings()->setAttribute(QWebEngineSettings::TouchIconsEnabled, true); QWebEngineProfile::defaultProfile()->settings()->setAttribute(QWebEngineSettings::WebGLEnabled, true); QWebEngineProfile::defaultProfile()->settings()->setAttribute(QWebEngineSettings::HyperlinkAuditingEnabled, true); QWebEngineProfile::defaultProfile()->settings()->setAttribute(QWebEngineSettings::PluginsEnabled, true); QWebEngineProfile::defaultProfile()->setPersistentCookiesPolicy(QWebEngineProfile::ForcePersistentCookies); QWebEngineProfile::defaultProfile()->setCachePath("/home/xx/Doc/coockie"); QWebEngineProfile::defaultProfile()->setPersistentStoragePath("/home/xx/Doc/chache"); ui->webW->settings()->setAttribute(QWebEngineSettings::PluginsEnabled, true); ui->webW->settings()->setAttribute(QWebEngineSettings::DnsPrefetchEnabled, true); ui->webW->settings()->setAttribute(QWebEngineSettings::ScreenCaptureEnabled, true); ui->webW->settings()->setAttribute(QWebEngineSettings::PdfViewerEnabled, true); ui->webW->settings()->setAttribute(QWebEngineSettings::JavascriptEnabled, true); ui->webW->settings()->setAttribute(QWebEngineSettings::Accelerated2dCanvasEnabled, true); ui->webW->settings()->setAttribute(QWebEngineSettings::TouchIconsEnabled, true); ui->webW->settings()->setAttribute(QWebEngineSettings::WebGLEnabled, true); ui->webW->settings()->setAttribute(QWebEngineSettings::HyperlinkAuditingEnabled, true);
-
i reply by my own:
QWebEngineProfile::defaultProfile()->settings()->setAttribute(QWebEngineSettings::PluginsEnabled, true); QWebEngineProfile::defaultProfile()->settings()->setAttribute(QWebEngineSettings::DnsPrefetchEnabled, true); QWebEngineProfile::defaultProfile()->settings()->setAttribute(QWebEngineSettings::ScreenCaptureEnabled, true); QWebEngineProfile::defaultProfile()->settings()->setAttribute(QWebEngineSettings::PdfViewerEnabled, true); QWebEngineProfile::defaultProfile()->settings()->setAttribute(QWebEngineSettings::JavascriptEnabled, true); QWebEngineProfile::defaultProfile()->settings()->setAttribute(QWebEngineSettings::Accelerated2dCanvasEnabled, true); QWebEngineProfile::defaultProfile()->settings()->setAttribute(QWebEngineSettings::TouchIconsEnabled, true); QWebEngineProfile::defaultProfile()->settings()->setAttribute(QWebEngineSettings::WebGLEnabled, true); QWebEngineProfile::defaultProfile()->settings()->setAttribute(QWebEngineSettings::HyperlinkAuditingEnabled, true); QWebEngineProfile::defaultProfile()->settings()->setAttribute(QWebEngineSettings::PluginsEnabled, true); QWebEngineProfile::defaultProfile()->setPersistentCookiesPolicy(QWebEngineProfile::ForcePersistentCookies); QWebEngineProfile::defaultProfile()->setCachePath("/home/xx/Doc/coockie"); QWebEngineProfile::defaultProfile()->setPersistentStoragePath("/home/xx/Doc/chache");
seems these settings is enought and no need other ..... after some test I see significant improovemnt of loading page addin the last pieces of code .... and no see better result with the original code posted ..... I see differences only if leave aout "profile" settings ..... but only because chache and coockies is not used in "standard" mode ....
Perhaps if you have some eavy process run on gui qwebengineview show web pages slowly with ethernet connection at 1Gb .... where onpecv show realtime grab in fluent way ......
So seems qwebvidgetengine is ok only for real small opertation on web ..... like dowload somethings or starting a chat ..... not for sure for play a video in streaming for example ..... or maybe I make something wrong (on that pc I have the latest chromium and chrome version).
best regards
-