[Interest] QWebView -> QWebSettings::enablePersistentStorage() unable to change directory

gsmember gs gsmember at hotmail.de
Sun Nov 24 22:26:35 CET 2013


Hello,
I have a problem with QWebSettings and multipe QWebView's.

In my "MainWindow" class I create 4 instances of QWebView with exact the same settings, except for the path passed to enablePersistentStorage(path). The path is generated randomly.
After calling this the four QWebView werle loaded. But it seems that the "IconDatabasePath" does not change. The "WebpageIcons.db" (which holds the Icons) is only created in the directory of the first QWebView. I need to separate all files crated by QWebView and every Subclassess of this object.

My code (this piece of code is called four times, as mentioned above):

QWebview *webView=new QWebView();
cacheDirPath=QString::number(qrand());

webView->setPage(webPage);

webView->settings()->enablePersistentStorage(QDir::currentPath()+"/cache/"+cacheDirPath);
webView->load(request);

connect(webView, SIGNAL(loadFinished(bool)), this, SLOT(slot_loadFinished()));



I have also tried to set the paths manually:
webView->settings()->setLocalStoragePath(QDir::currentPath()+"/cache/"+cacheDirPath);
webView->settings()->setOfflineStoragePath(QDir::currentPath()+"/cache/"+cacheDirPath);
webView->settings()->setIconDatabasePath(QDir::currentPath()+"/cache/"+cacheDirPath);
webView->settings()->setOfflineWebApplicationCachePath(QDir::currentPath()+"/cache/"+cacheDirPath);

Best regards,
_gs
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20131124/5d8677af/attachment.html>


More information about the Interest mailing list