QWebview Downloading Issue



  • I loaded a url using QWebview. I need to download a file by clicking another link from web page which is loaded QWebView. I have a following code

    widget.cpp:
    ui->webView->load(QUrl("http://my_url"));
    ui->webView->page()->setForwardUnsupportedContent(true);
    connect(ui->webView> page() , SIGNAL(downloadRequested(QNetworkRequest)) ,
    this, SLOT(download(QNetworkRequest)));
    connect(ui->webView->page(), SIGNAL(unsupportedContent(QNetworkReply*)),
    this,SLOT(unsupportedContent(QNetworkReply*)));

    But downloadRequested() only called for right click. But when directly link click, it does not emit any signal. Is there any other signal when click on downloading link in Qwebview?

    Thank you.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.