Results 1 to 2 of 2

Thread: QWebKit enabling cache

  1. #1
    Join Date
    Dec 2008
    Location
    Poland
    Posts
    383
    Thanks
    52
    Thanked 42 Times in 42 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Android

    Default QWebKit enabling cache

    Hello,
    I try to enable caching functionality in QWebKit but can't get it to work entirely. i use this code to enable it:

    Qt Code:
    1. /** cache */
    2. bool switch_bool = true;
    3. QString cacheDir = QDir::toNativeSeparators( QDir::currentPath() + "/cache" );
    4.  
    5. quint64 num = 5 * 1024 * 1024;
    6.  
    7. QWebSettings::globalSettings()->enablePersistentStorage( cacheDir );
    8. QWebSettings::globalSettings()->setMaximumPagesInCache( 3 );
    9. QWebSettings::globalSettings()->setOfflineStorageDefaultQuota(num);
    10. QWebSettings::globalSettings()->setOfflineWebApplicationCacheQuota(num);
    11. QWebSettings::globalSettings()->setAttribute(QWebSettings::OfflineStorageDatabaseEnabled, switch_bool);
    12. QWebSettings::globalSettings()->setAttribute(QWebSettings::OfflineWebApplicationCacheEnabled, switch_bool);
    13. QWebSettings::globalSettings()->setAttribute(QWebSettings::LocalStorageEnabled, switch_bool);
    14. QWebSettings::globalSettings()->setOfflineStoragePath(cacheDir);
    15. QWebSettings::globalSettings()->setOfflineWebApplicationCachePath(cacheDir);
    16. QWebSettings::globalSettings()->setLocalStoragePath(cacheDir);
    To copy to clipboard, switch view to plain text mode 
    and according to the doc that should do the trick, but ... what I got is only cache for the icons, WebpageIcons.db.
    The directory exist (but that doesn't mater because dir. is created automatically if not exists).
    I try to use this on webview->settings(), webview->page()->settings() but the end result is the same.

    Win Qt 4.7.0 - 4.7.2

    Any help is more then welcome
    Regards
    In the near future - corporate networks reach out to the stars. Electrons and light flow throughout the universe.
    The advance of computerization however, has not yet wiped out nations and ethnic groups.

  2. #2
    Join Date
    Apr 2011
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question Re: QWebKit enabling cache

    Any progress on enabling the cache?

Similar Threads

  1. Cache of Credential
    By lyhoanghai in forum Qt Programming
    Replies: 1
    Last Post: 18th January 2011, 11:15
  2. Replies: 4
    Last Post: 13th July 2010, 21:04
  3. Clear a cache!
    By Indalo in forum Qwt
    Replies: 1
    Last Post: 5th March 2010, 16:59
  4. Replies: 1
    Last Post: 18th December 2009, 11:20
  5. using QWebView cache with QNetworkDiskCache
    By Jann3 in forum Qt Programming
    Replies: 3
    Last Post: 7th October 2009, 13:23

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.