Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to force update a hidden window?
Forum Updated to NodeBB v4.3 + New Features

How to force update a hidden window?

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 2 Posters 1.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DevExpert
    wrote on last edited by
    #1

    Hello!

    I'm working with QtWebEngine. I have a very heavy page. When the page is loaded I show another QWindow (a splash window).

    I subscribe on loadingChanged signal of the QQuickWebEngineView by which I show the window with webview.

    The problem is that QWE loads a content, but does not draws it in the QSG until the window will be shown. How I see, the QWE catch OnSwapCompositorFrame, call QQuickItem::update() and it's all, nothing else happens. The updatePaintNode is called just after the window is shown.

    If I use the QPainter (--disable-delegated-renderer) instead QSG all work well.

    How to force update a hidden window?

    1 Reply Last reply
    0
    • D Offline
      D Offline
      DevExpert
      wrote on last edited by
      #2

      I did some hacks, but I think there will be side effects, will be?

      Edit src/webengine/render_widget_host_view_qt_delegate_quick.cpp
      @
      void RenderWidgetHostViewQtDelegateQuick::update(const QRect&)
      {
      if (window()->isVisible()) {
      if (hiddenNode) {
      delete hiddenNode;
      hiddenNode = NULL;
      }
      QQuickItem::update();
      } else {
      hiddenNode = updatePaintNode(hiddenNode, NULL);
      }
      }
      @

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jturcotte
        wrote on last edited by
        #3

        Your hack might cause some resources to leak if there are cases where your hiddenNode isn't destroyed, but it doesn't look too bad.

        I don't understand what is the issue though, why do you want updatePaintNode to be called before the window is visible? That would be a waste unless you are using the output somewhere.

        1 Reply Last reply
        0
        • D Offline
          D Offline
          DevExpert
          wrote on last edited by
          #4

          Thanks for the answer. I destroy the hiddenNode in the destructor of the RenderWidgetHostViewQtDelegateQuick.

          The problem is that QtWebEngine sends the "loaded" signal, which means that a page been loaded. But when I show the window with webview, it appears with white background for a second or two. It's looks terribly.

          As I understand, the problem connected to the way of update QSG

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved