[Qtwebengine] QWebEngine(page): How to detect that rendering process has finished

Michal Klocek michal.klocek at qt.io
Tue Nov 9 20:57:38 CET 2021


Hi

Please open bug report at https://bugreports.qt.io as this better place to discuss issues with rendering / flickering.

As rendering pipeline got modified during version of qt it is quite hard to suggest the workaround or solution without knowing the exact version and not seeing simple example showing the issue. Also loadFinished signal was fixed in later version to be more accurate.

Please note however, that qwebenigneview has setPage and you can simply create and load the new qwebenignepage and than set view on it, instead of reloading of not visible page.

Br

Michal

System Dashboard - Qt Bug Tracker<https://bugreports.qt.io/>
System Dashboard . Tools. View as wallboard
bugreports.qt.io

________________________________
From: QtWebEngine <qtwebengine-bounces at lists.qt-project.org> on behalf of Jakob Lettenbichler <jakob.lettenbichler at artech.at>
Sent: Tuesday, 9 November 2021 11:21
To: qtwebengine at lists.qt-project.org <qtwebengine at lists.qt-project.org>; qtwebengine at lists.qt-project.org <qtwebengine at lists.qt-project.org>
Subject: [Qtwebengine] QWebEngine(page): How to detect that rendering process has finished


Hiho,



First of all, thanks for the QWebEngine, it is a neat wrapper for the WebEngine and gets a lot of hooks out of that huge black box.



To the question: I want to switch the page content (load a new url), which I do while the QWebengine is invisible.

I get the loadFinished() signal (as correctly stated by the documentation, this is no hint for rendering being done, https://doc.qt.io/qt-5/qwebenginepage.html#loadFinished) and sometime later I set the Widget to visible.

But the page is only rendered then, which means, although the new page is already loaded, the old page is visible until rendering is done.

This leads to a flickering after being set to visible, which I want to avoid.

Current ugly solution: paint a white rectangle over the widget for a few ms to hide the old page, which is of course stupid, since I do not know when the actual rendering is finished, so I need to show the rectangle long enough to cover corner cases.



As far as I understand the documentation, the rendering is done in a separate rendering process, which terminates after being done (https://doc.qt.io/qt-5/qwebenginepage.html#renderProcessTerminated, since Qt5.6) but that signal is only emitted, if there was a non-regular termination state (meaning, when something went wrong).

But there seems to be no signal for successful rendering done (or shall https://doc.qt.io/qt-5/qwebenginepage.html#renderProcessPidChanged (since Qt5.12) be the information I need?)

If the renderProcessPidChanged signal does not indicate that the page has been finished rendering its content, how do I get that information?



As one can guess, our embedded platform still runs an outdated Qt Version (5.9 LTS), but we will finally switch to Qt5.15 LTS soon (Qt6 is out of the question for the moment, due to broken backward compatibility), which is still supported for our commercial licence.

Therefore, I currently cannot check my theory about renderingProcessPidChanged being the actual solution to my problem.



So, does anyone here know whether 5.15 will be my salvation, or not?

Is there an alternative way to detect the rendering being done?



Many, many thanks for any suggestions,

Cheers,

Jakob





FN 181686 k. HG Wien, UID-Nr. ATU 47056901, zertifiziert nach ISO 9001:2015 Nr. 04036/0
Der Inhalt dieser E-Mail ist vertraulich und ausschließlich für den bezeichneten Adressaten bestimmt. Wenn Sie nicht der vorgesehene Adressat dieser E-Mail oder dessen Vertreter sein sollten, so beachten Sie bitte, dass jede Form der Kenntnisnahme, Veröffentlichung, Vervielfältigung oder Weitergabe des Inhaltes dieser E-Mail unzulässig ist. Wir bitten Sie, sich in diesem Fall mit dem Absender der E-Mail in Verbindung zu setzen und die E-Mail zu vernichten. Für Übermittlungsfehler oder sonstige Irrtümer bei der Übermittlung besteht keine Haftung.
This e-mail is intended solely for the person to whom it is addressed and may contain confidential or legally privileged information. Access to this e-mail by anyone else is unauthorized. If an addressing or transmission error has misdirected this e-mail, please notify the author by replying to this e-mail and destroy this e-mail and any attachments. E-mail may be susceptible to data corruption, interception, unauthorized amendment, viruses and delays or the consequences thereof. If you are not the intended recipient, be advised that you have received this e-mail in error and that any use, dissemination, forwarding, printing or copying of this e-mail is strictly prohibited.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qtwebengine/attachments/20211109/c2f34e4e/attachment.html>


More information about the QtWebEngine mailing list