How to make Qt support HTML 5 database?

I am using Qt 4.7.1 and have embedded webview in my application. But when I tried to visit http://webkit.org/demos/sticky-notes/ , I got the following error:

Failed to open the database on disk. This is probably because the version was bad or there is not enough space left in this domain quota 

I compiled a Qt static library with the following command:

 configure --prefix=/usr/local/qt-static-release-db --accessibility --multimedia --audio-backend --svg --webkit --javascript-jit --script --scripttools --declarative --release -nomake examples -nomake demos --static --openssl -I /usr/local/ssl/include -L /usr/local/ssl/lib -confirm-license -sql-qsqlite -sql-qmysql -sql-qodbc 
+4
source share
1 answer

Check the QWebSettings documentation.

In particular, you should use setAttribute to enable QWebSettings :: OfflineStorageDatabaseEnabled and specify local storage using setOfflineStoragePath (e.g. QDesktopServices :: DataLocation ).

You might want to do this on a page, but as an example, you can do this globally with:

  QWebSettings::globalSettings()->setAttribute(QWebSettings::OfflineStorageDatabaseEnabled, true); QWebSettings::globalSettings()->setOfflineStoragePath(QDesktopServices::storageLocation(QDesktopServices::DataLocation)); 
+5
source

Source: https://habr.com/ru/post/1333440/


All Articles