Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-123488

No QML WebEngineView paint events when using QQuickRenderControl

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 6.6.2
    • WebEngine
    • None
    • macOS

      I am rendering WebEngineView into QQuickRenderControl. I need to wait until it actually paints the contents before rendering to avoid rendering a blank page.

      I tried two approaches to detecting when it has rendered - requestAnimationFrame/MessageChannel as described here https://webperf.tips/tip/measuring-paint-time/
      And PerformanceObserver/largest-contentful-paint as described here https://developer.mozilla.org/en-US/docs/Web/API/LargestContentfulPaint

      Both of these techniques work when not using QQuickRenderControl. You can run the attached test-paint.qml (which uses test-paint.html) using the qml viewer:

      > qml test-paint.qml
      qml: in runAfterFramePaint
      qml: onLoad
      qml: in requestAnimationFrame
      qml: after frame paint
      qml: [object LargestContentfulPaint]
      

      When using QQuickRenderControl, neither of these events fire. Build the attached test application and run with raf-paint.html to test requestAnimationFrame or with lcp-paint.html to test largest-contentful-paint:

      > ./rendercontrol ../raf-paint.html
      qml: onLoad
      qml: WebChannel [object Object]
      qml: runAfterFramePaint
      
      > ./rendercontrol ../lcp-paint.html
      qml: onLoad
      qml: WebChannel [object Object]
      

      Why do these not work when using QQuickRenderControl? Is there some other technique to detect when WebEngineView has painted so I can defer rendering into the QQuickRenderControl until after it has painted content?

        1. webenginepaint.zip
          7 kB
          Andrew Wason
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qt_webengine_team Qt WebEngine Team
            rectalogic Andrew Wason
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes