Unsolved How to get signal and download link from WebView
-
Hi!
How to get signal and download link from WebView -
@mikeeeeee hi,
google qml WebView download
its shorter than the question you typed 2 times for some reason
-
I already did, but I couldn't find an answer. If you read the pages issued by Google, you will not find the answer.
-
I made a file Downloader, I need to get the download signal and download link.
-
@mikeeeeee said in How to get signal and download link from WebView:
download signal
What signal is that? Do you mean if the user clicks on a link, or what?
-
@mikeeeeee said in How to get signal and download link from WebView:
I need to get the download signal and download link.
im not sure what that means
-
The user clicks the download button. I need him to press a button, get a download link.
-
WebView in C++ gave signals when you need to download a file. How to do this in QML?
-
In c++ this work, how I can get signal for download in QML?
MainWindow::MainWindow(QWidget parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
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*)));
}MainWindow::~MainWindow()
{
delete ui;
}void MainWindow::download(const QNetworkRequest &request){
// request.url() - это то, откуда вам нужно скачать файл или изображение
qDebug()<<"Download Requested: "<<request.url();
}void MainWindow::unsupportedContent(QNetworkReply * reply){
qDebug()<<"Unsupported Content: "<<reply->url();
}
-
Set a proper WebEngineProfile to your
WebEngineView
, then usedownloadRequested
signal. -
But WebEngine does not compile for Android.
-
I need a WebView solution.
-
Looks like there is no easy solution for Android. If you are good enough in Java and JNI you can probably change QtAndroidWebViewController and set download listener. Not sure if it possible, just quick look into it leads me there.
-
I don't know how to do that. Help please with this.