budda
26th April 2011, 12:48
I have used connection signals & slots before, but always with a ui->pushButton, a ui->action, or a ui->actionToolBar.... I guess my question is how to do this with a webView event?
Trying to download a file through the course of going through some webpages, I don't want to have a seperate QButton to download the file when it finally is sent to the QWebView, but a connection signal/slot to realize that it is a file with extension of .xls (already created) just need to trigger a method to start the QFileDialog::getSaveFileName() function... can this be a connection through the QWebView?
ui->setupUi(this);
ui->webView->load(QUrl("http://site.com/index.php"));
ui->webView->show();
//now put connection for checking class method if a changed url is actually a file with .xls extension
connect(ui->webView, SIGNAL(urlChanged(QUrl url&)), this, SLOT(checkForXLS()));
Trying to download a file through the course of going through some webpages, I don't want to have a seperate QButton to download the file when it finally is sent to the QWebView, but a connection signal/slot to realize that it is a file with extension of .xls (already created) just need to trigger a method to start the QFileDialog::getSaveFileName() function... can this be a connection through the QWebView?
ui->setupUi(this);
ui->webView->load(QUrl("http://site.com/index.php"));
ui->webView->show();
//now put connection for checking class method if a changed url is actually a file with .xls extension
connect(ui->webView, SIGNAL(urlChanged(QUrl url&)), this, SLOT(checkForXLS()));