Results 1 to 3 of 3

Thread: Custom qNetworkAccessManager for WebView

  1. #1
    Join Date
    Nov 2008
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Custom qNetworkAccessManager for WebView

    Hi everyone,
    Straight to the point I want to use custom NetworkAccessManager for QWebView in my application to serve images from memory instead form network. Can anyone know how to do this? I've tried to use setNetworkAccessManager but with no luck Any ideas? Thanks a lot in advance.

  2. #2
    Join Date
    Jan 2006
    Location
    Alingsås, Sweden
    Posts
    437
    Thanks
    3
    Thanked 39 Times in 39 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Custom qNetworkAccessManager for WebView

    Could you show some more code? I think that setNetworkAccessManager aught to work.

  3. #3
    Join Date
    May 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Custom qNetworkAccessManager for WebView

    You need to create a QWebPage object and use the setPage function in QWebView. You can then set the accessmanager on the web page and use load from QWebView.

    here is some rough example code (not compilable, just something to get you going):

    Qt Code:
    1. Qpointer<QWebPage> _webPage = new QWebPage();
    2. QPointer<QWebView> _webView = new QWebview();
    3. QNetworkAccessManager am = new QNetworkAccessManager();
    4.  
    5. QWebView->setPage(_webPage);
    6.  
    7. _webPage -> setNetworkAccessManager(am);
    8.  
    9. _webView->load(QUrl("http://www.google.com.au"));
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Problem building application with custom widget
    By Uthar in forum Installation and Deployment
    Replies: 6
    Last Post: 19th January 2009, 17:57
  2. Replies: 2
    Last Post: 16th May 2008, 14:39
  3. Custom widget
    By zorro68 in forum Qt Programming
    Replies: 7
    Last Post: 28th January 2008, 14:06
  4. Custom proxy model issue
    By Khal Drogo in forum Qt Programming
    Replies: 13
    Last Post: 30th November 2007, 12:41
  5. custom plug-in widget in another custom plug-in widget.
    By MrGarbage in forum Qt Programming
    Replies: 6
    Last Post: 27th August 2007, 15:38

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.