How to force update a hidden window?



  • 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?



  • 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);
    }
    }
    @



  • 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.



  • 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


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.