For what ever reason can't get QWenEngineProfile to invoke downloadRequest when downloading a file with QWebEnginePage. The way I understand it is that when QWebEnginePage::download() is called the QWebEningeProfile::downloadRequested() signal is emitted but for some reason my code doesn't catch the signal.

mainwindow.ccp

Qt Code:
  1. WebPageDownload *webPageDownload = new WebPageDownload(this);
  2. webPageDownload->download("https://www.nasdaq.com/screening/companies-by-industry.aspx?exchange=NASDAQ&render=download", "file.cvs");
To copy to clipboard, switch view to plain text mode 
webpagedownload.cpp

Qt Code:
  1. WebPageDownload::WebPageDownload(QObject *parent){
  2. page = new QWebEnginePage(parent);
  3. connect(page->profile(), SIGNAL(downloadRequested(QWebEngineDownloadItem*)), this, SLOT(downloadRequested(QWebEngineDownloadItem*)));
  4. }
  5.  
  6. void WebPageDownload::download(const QUrl &url, const QString &filename){
  7. qDebug()<<"download called";
  8. //this should emit QWebEngineProfile::downloadRequested
  9. page->download(url, filename);
  10. }
  11.  
  12. void WebPageDownload::downloadRequested(QWebEngineDownloadItem* download) {
  13. qDebug()<<"Download request invoked";
  14. }
To copy to clipboard, switch view to plain text mode 
webpagedownload.h

Qt Code:
  1. class WebPageDownload : public QObject{
  2. Q_OBJECT
  3.  
  4. public:
  5. WebPageDownload(QObject *parent = nullptr);
  6.  
  7. private:
  8. QWebEnginePage *page;
  9.  
  10. private slots:
  11. void downloadRequested(QWebEngineDownloadItem* download);
  12.  
  13. public slots:
  14. void download(const QUrl &url, const QString &filename = QString());
To copy to clipboard, switch view to plain text mode