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

QWebChannel does not work with QWebEngine (standalone example)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.5.1
    • Fix Version/s: 5.6.0
    • Component/s: WebChannel, WebEngine
    • Labels:
      None
    • Environment:
      XUbubtu 14.04 32 Bit in Virtual Machine on Windows 7

      Description

      I tried the standalone webchannel example on Linux (Ubuntu 14.04). It works correctly with the standard browser firefox (Version 43.0). Then I changed the example program to use the Qt WebEngine in the following way:

      instead of
      QDesktopServices::openUrl(url);

      I instantiate a QWebEngineView (I also included QWebEngineView and added webenginewidgets in the list of used modules):

      QWebEngineView webView;
      webView.load(url);
      webView.show();

      When I start the new application I have two separate windows. One with the C++ dialog and another with the Web-page.

      The C++-Dialog shows the text
      Initializing WebChannel...
      Initialization complete, opening browser at file:///home/oepnv/work/examples/build-webchannel-Desktop_Qt_5_5_1_GCC_32bit-Debug/standalone/index.html?webChannelBaseUrl=ws://127.0.0.1:12345.

      And the Web-Dialog shows:
      Connecting to WebSocket server at ws://127.0.0.1:12345.

      So the initialization of the WebCannel is not complete and I cannot send messages.

      If I open firefox with the printed Url the channel is initialized correctly:

      Connecting to WebSocket server at ws://127.0.0.1:12345.
      WebSocket connected, setting up QWebChannel.
      Connected to WebChannel, ready to send/receive messages!

      And I can send messages from there.

      I also tried this under WIndows (Windows 7). Here the program crashes the web-view-window.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            qt_webengine_team Qt WebEngine Team
            Reporter:
            rsprengel Rainer Sprengel
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes