Как TL;DR я хочу, чтобы мое приложение сохраняло файлы cookie и данные кэша (таким образом, сохраняло логины на веб-сайте), но оно отказывается это делать. Итак.
Моя попытка настройки постоянные настройки в веб-представлении можно найти ниже.
Код: Выделить всё
QWebEngineProfile *PersistentProfile = new QWebEngineProfile(this);
QString storagePath = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + QStringLiteral("/PersistentProfile");
if (!QDir(storagePath).exists()) {
QDir().mkpath(storagePath);
}
PersistentProfile->setPersistentStoragePath(storagePath);
PersistentProfile->setCachePath(storagePath);
PersistentProfile->setPersistentCookiesPolicy(QWebEngineProfile::ForcePersistentCookies);
PersistentProfile->settings()->setAttribute(QWebEngineSettings::LocalStorageEnabled, true);
PersistentProfile->settings()->setAttribute(QWebEngineSettings::LocalContentCanAccessRemoteUrls, true);
PersistentProfile->settings()->setAttribute(QWebEngineSettings::XSSAuditingEnabled, false);
QWebEnginePage *profilepage = new QWebEnginePage(PersistentProfile, this);
QWebEngineView *webView = new QWebEngineView(this);
webView->setPage(profilepage);
Подробнее здесь: https://stackoverflow.com/questions/793 ... n-qt-6-8-c