79329416

Date: 2025-01-04 18:54:46
Score: 1
Natty:
Report link

Using the advice given by @IgorTandetnik along with a bit of tinkering, I was able to solve my own question.

The main issue stems from defining the QWebEngineProfile constructor without the storageName parameter, which results in a off-the-record profile, rather than one that would hold persistent cache and cookies. So, rather than incorrectly using QWebEnginePage *profilepage = new QWebEnginePage(PersistentProfile, this);, as it does not contain the optional storageName parameter, it is correct to define the constructor as QWebEngineProfile *PersistentProfile = new QWebEngineProfile(QStringLiteral("PersistentProfile"), this);, which does.

Further, the second issue I found in my code originates in how I defined the storage path. In my testing, QStandardPaths::AppDataLocation was not accessible to the application while in a build environment under my IDE. Rather, I had to specify a direct, full path to a folder in the build directory for the application to find the correct storage location. From my research, when publishing and bundling the application, however, using QStandardPaths::AppDataLocation is correct, but does not seem to work in a build environment.

Reasons:
  • Long answer (-1):
  • Has code block (-0.5):
  • User mentioned (1): @IgorTandetnik
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Jesus Coder