Currently I am trying to do this by accessing the “QWebView” object. Following is the code that I use:
QObject* window = getQmlWindow("appWindow"); // returns the top-level qml ApplicationWindow
QObject* webView = window->findChild<QObject*>("QWebView"); // WebView has an objectName = "QWebView"
QWebView* qWebView = static_cast<QWebView *>(webView); // Cast QObject to QWebView
qWebView->page()->networkAccessManager()->setCookieJar(cookies); // cookies is of type QNetworkCookieJar*
it gives a segmentation fault error while accessing networkAccessManager().
Am i doing it in the right way? Is there any other ways to set cookies for Qml WebView. I am using QtQuick 5.1 and QtWebKit 3.0.
Note: