- 在QWebEngine和webkit下载有区别:
在QWebEngine下载相关信号在QWebEngineProfile中需要连接QWebengineview中QWebEngineProfile中downloadRequested信号做处理
下载槽函数实例
void MainWidget::Down(QWebEngineDownloadItem*softdownload)
{
connect(softdownload,SIGNAL(finished()),this,SLOT(Finish()));
QString path = qApp->applicationDirPath()+"/"+ softdownload->path();
if (path.isEmpty())
return;
softdownload->setPath(path);
softdownload->accept();
}