Results 1 to 5 of 5

Thread: QWebEngineView LocalStorage

  1. #1
    Join Date
    Nov 2015
    Posts
    22
    Thanks
    1
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default QWebEngineView LocalStorage

    Greetings,

    My application uses QWebEngineView and we utilize local storage. While testing I need the ability to remove the file being used for storage. I can't find in the documentation where the local storage is kept. I'd also like to be able to set the path, which looks like was achievable with web kit but I don't see the same option for the web engine.

    So A) Can anyone point me in the direction of where the local storage is kept? and B) Does anyone know if you can set the path to one of your choosing?

    Thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QWebEngineView LocalStorage

    My guess would be that it is using QStandardPaths, likely AppDataLocation or AppLocalDataLocation

    Cheers,
    _

  3. #3
    Join Date
    Nov 2015
    Posts
    22
    Thanks
    1
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: QWebEngineView LocalStorage

    Thanks anda_skoa. I looked that over but doesn't seem to be where the HTML5 local storage is kept. I looked in both location and several others listed in the documentation there but found nothing for my application.


    Added after 32 minutes:


    Ok, I found that it should be under the QWebEngineProfile > persistentStoragePath, but I'm not seeing how to pull this profile from my instance of QWebEngineView.
    Last edited by brixel; 27th April 2016 at 20:49.

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QWebEngineView LocalStorage

    Quote Originally Posted by brixel View Post
    Ok, I found that it should be under the QWebEngineProfile > persistentStoragePath, but I'm not seeing how to pull this profile from my instance of QWebEngineView.
    QWenEngineView::page(), then QWebEnginePage::profile().

    Cheers,
    _

  5. #5
    Join Date
    Nov 2015
    Posts
    22
    Thanks
    1
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: QWebEngineView LocalStorage

    I have found that I can at least obtain the path using the defaultProfile from QWebEngineProfile, however when I try to set the path to something else the program keeps crashing on every run. No stack trace is provided, the application simply crashes with "The program has unexpectedly finished.".

    Are you unable to change the local storage path for the default profile?

    Quote Originally Posted by anda_skoa View Post
    Thanks - I gave that a try and the program is still faulting when I try to use setPersistentStoragePath. I can get the path and display it, but when I try and set it the program crashes.

    Qt Code:
    1. webview->page()->profile()->setPersistentStoragePath(somepath); // Causes program to crash.
    To copy to clipboard, switch view to plain text mode 
    Last edited by brixel; 28th April 2016 at 11:24.

Similar Threads

  1. How to know when a QWebEngineView has properly loaded?
    By domusmaximus in forum Qt Programming
    Replies: 0
    Last Post: 17th January 2016, 18:10
  2. QWebEngineView Touch Crash
    By cbennett in forum Qt Programming
    Replies: 0
    Last Post: 21st July 2015, 17:31
  3. How to set QWebEngineView on QQuickView
    By ejoshva in forum Newbie
    Replies: 112
    Last Post: 11th July 2015, 09:07
  4. Loading QDeclarativeView in QWebEngineView
    By ejoshva in forum Newbie
    Replies: 8
    Last Post: 7th May 2015, 09:38
  5. Problem with LocalStorage
    By witusx93 in forum Qt Quick
    Replies: 5
    Last Post: 20th April 2015, 19:06

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.