[Qtwebengine] How to tell when DOM resources finishes downloading?
Kai.Koehne at theqtcompany.com
Mon Nov 23 08:59:10 CET 2015
> -----Original Message-----
> From: QtWebEngine [mailto:qtwebengine-bounces at qt-project.org] On Behalf
> Of Kevin Truong
> Sent: Friday, November 20, 2015 6:53 AM
> To: qtwebengine at qt-project.org
> Subject: [Qtwebengine] How to tell when DOM resources finishes downloading?
> I have a website that loads resources such as images, iframes, ajax, scripts, etc.
> Running qt web engine on this website, I found a way for the render to time the
> exact moment these requests were initiated by subclassing
> QWebEngineUrlRequestInterceptor, and passing that class to m_page.profile()-
> However, I would also like to time when these DOM resources finish
> downloading as well. This was possible in qt webkit, so I was hoping there's a
> way to do it for qt webengine.
If you could explain your use case it might be easier to give you advice.
I understood you already looked into QWebEngineView::loadFinished(),
but you couldn't use it for some reason?
> One example I thought was the solution is the signal
> *download). This signal allows me to access the QWebEngineDownloadItem
> object, which signals when the download has finished, which is basically what I
> am looking for. However, this signal doesn't ever seem to be executed. I think it
> is only run when e.g. a user clicks on a download link, rather than being run for
> every DOM resource being loaded.
downloadRequested() is only emitted basically for things that the user wants
to explicitly save on disk (something that will show up in a browser's download
manager). So I don’t think you can use that to profile the DOM progress.
More information about the QtWebEngine