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

Infinite loop using QWebEngineView

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P3: Somewhat important P3: Somewhat important
    • 5.12.0
    • 5.9.2
    • WebEngine
    • None
    • Windows 64 bits

      I got an infinite loop when using QWebEngineView, this way:

      • I create a QWebEngineView, and call setHtml()
      • During the Html loading, the "RenderWidgetHostViewQtDelegateWidget::setKeyboardFocus" calls "QGuiApplication::sync()"
      • If the page takes more than 5 seconds to load, my application aborts and tries to load another QWebEngineView, posting a message to Qt
      • This new QWebEngineView receives the message to load during this QGuiApplication::sync, and starts the same loop all over again.

      This really isn't a "normal" application flow, but the point is, I thing calling QGuiApplication::sync is a very bad idea, many things can happen in the event loop, even deleting the currently running QWebEngineView.

      The QGuiApplication::sync comments even says:
      "This function is timeconsuming and its use is discouraged."

      This was the commit that introduced this:

      http://code.qt.io/cgit/qt/qtwebengine.git/commit/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp?id=01c029fd90162bdbbcf9534537f26138a333c570

        For Gerrit Dashboard: QTBUG-64501
        # Subject Branch Project Status CR V

            juri.valdmann Jüri Valdmann (Inactive)
            rangelspam@gmail.com Rangel Reale
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes