estou criando uma webview está pronta. porém quando eu faço login em algum site ele não salva a session.Ou seja quando eu desligo o pc ele perde o login,Alguém tem alguma ideía? #include "main.moc"
int main(int argc, char *argv[]) {
QtWebView::initialize();
// QGuiApplication app(argc, argv);
QApplication app(argc, argv); // Inicializar QApplication
//! [0]
QGuiApplication::setApplicationDisplayName(QCoreApplication::translate("main",
"QtWebView Example"));
QWebEngineView view;
// WebPage page;
// // Configurar a página da web para ser usada na visualização da web
// view.setPage(&page);
QCommandLineParser parser;
QCoreApplication::setApplicationVersion(QT_VERSION_STR);
parser.setApplicationDescription(QGuiApplication::applicationDisplayName());
parser.addHelpOption();
parser.addVersionOption();
parser.addPositionalArgument("url", "The initial URL to open.");
QStringList arguments = app.arguments();
parser.process(arguments);
const QString initialUrl = parser.positionalArguments().isEmpty() ?
QStringLiteral("https://google.com") : parser.positionalArguments().first();
QWebEngineProfile profile;
// Configure profile as needed
QQmlApplicationEngine engine;
QQmlContext *context = engine.rootContext();
context->setContextProperty(QStringLiteral("utils"), new Utils(&engine));
context->setContextProperty(QStringLiteral("initialUrl"),
Utils::fromUserInput(initialUrl));
QRect geometry = QGuiApplication::primaryScreen()->availableGeometry();
if (!QGuiApplication::styleHints()->showIsFullScreen()) {
const QSize size = geometry.size() * 4 / 5;
const QSize offset = (geometry.size() - size) / 2;
const QPoint pos = geometry.topLeft() + QPoint(offset.width(), offset.height());
geometry = QRect(pos, size);
}
// Instalação do filtro de eventos para capturar eventos de teclado
KeyPressFilter keyPressFilter;
app.installEventFilter(&keyPressFilter);
context->setContextProperty(QStringLiteral("initialX"), geometry.x());
context->setContextProperty(QStringLiteral("initialY"), geometry.y());
context->setContextProperty(QStringLiteral("initialWidth"), geometry.width());
context->setContextProperty(QStringLiteral("initialHeight"), geometry.height());
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
if (engine.rootObjects().isEmpty())
return -1;
return app.exec();
}