Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QtWebEngine JS Bridge
Forum Updated to NodeBB v4.3 + New Features

QtWebEngine JS Bridge

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 5.9k 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.
  • K Offline
    K Offline
    krekeltronics
    wrote on last edited by
    #1

    With Qt WebKit, we used the javaScriptWindowObjectCleared signal on the frame to do something like this:

    d->frame()->addToJavaScriptWindowObject("qMapView", this);

    In order to link an object in C++ to the JavaScript for simple messaging back and forth in our mapping application. I was excited to port to QtWebEngine since we're having some performance problems, to see if there would be any improvement to UI response. However, it is not clear whether or not C++ <=> JS communications are possible yet with the QWebEnginePage. I have seen some suggestion on the Trello board that QWebChannel would be used, but I can't see where this would integrate on the C++ side.

    With 5.4 beta or dev version of QtWebEngine is it possible to call C++ via QWebChannel or otherwise?

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

      The change to get this working in dev for 5.5 is at https://codereview.qt-project.org/93800 and isn't ready yet.

      Until then I think that you can already use the WebSockets backend of QtWebChannel.

      If not possible you can also pass raw messages through QWebEnginePage::runJavaScript using QJsonDocument.

      1 Reply Last reply
      0
      • K Offline
        K Offline
        krekeltronics
        wrote on last edited by
        #3

        Cool, I will play with that. The use case is pretty straightforward, just sending objects back and forth from a web container showing a map view with some overlays, markers, and infoboxes. The core data models and dynamic image generation are on the C++ side. If we come up with anything interesting we would be happy to release in generalized form for others' benefit

        Cheers,
        Patrick

        1 Reply Last reply
        0
        • T Offline
          T Offline
          trallallero
          wrote on last edited by
          #4

          @Patrick: I have the same problem and it's still not clear how to port it to webengine. did you play with it and learned something ? if yes, could you please share.

          Thanks
          Marco

          1 Reply Last reply
          0
          • T Offline
            T Offline
            trallallero
            wrote on last edited by
            #5

            @Patrick: I have the same problem and it's still not clear how to port it to webengine. did you play with it and learned something ? if yes, could you please share.

            Thanks
            Marco

            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