Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt WebKit
  4. Where is QNetworkReply data?
Forum Updated to NodeBB v4.3 + New Features

Where is QNetworkReply data?

Scheduled Pinned Locked Moved Qt WebKit
1 Posts 1 Posters 821 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    redbit
    wrote on last edited by
    #1

    @MyPage::MyPage(QWidget *parent) :
    QWebPage(parent), cache( new QNetworkDiskCache() )
    {
    QNetworkAccessManager *network = this->networkAccessManager();

    cache->setCacheDirectory("/Users/redbit/tmp");
    network->setCache( cache );
    
    connect( network, SIGNAL(finished(QNetworkReply*)), SLOT(networkFinish(QNetworkReply*)) );
    

    }
    void MyPage::networkFinish(QNetworkReply *reply)
    {
    qDebug() << "Request URL [" << reply->url() << "] reply reamin bytes [" << reply->bytesAvailable() << "] -- cache : " << cache->data( reply->url() );
    }
    @

    MyPage is Inherited QWebPage.

    @
    QWebView *v = new QWebView(this);
    MyPage *p = new MyPage(this);
    v->setPage(p);
    v->load("http://www.naver.com");
    @

    and This debug result is..

    ...
    Request URL [ QUrl( "http://www.naver.com/" ) ] reply reamin bytes [ 0 ] -- cache : QObject(0x0)
    Request URL [ QUrl( "http://www.naver.com/css/main_v20141105.css" ) ] reply reamin bytes [ 0 ] -- cache : QBuffer(0x7fd18267d200)
    Request URL [ QUrl( "http://sstatic.naver.net/search/css/2014/api_atcmp_0415.css" ) ] reply reamin bytes [ 0 ] -- cache : QBuffer(0x7fd1872a2540)
    Request URL [ QUrl( "http://www.naver.com/js/c/nlog_20140205.min.js" ) ] reply reamin bytes [ 0 ] -- cache : QBuffer(0x7fd18728e850)
    Request URL [ QUrl( "http://www.naver.com/js/c/nlog_20140205.min.js" ) ] reply reamin bytes [ 0 ] -- cache : QBuffer(0x7fd18728ced0)
    ...

    where can i find QUrl("http://www.naver.com/")'s content?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved