Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. HTML5-JS-C++ interaction
Forum Update on Monday, May 27th 2025

HTML5-JS-C++ interaction

Scheduled Pinned Locked Moved QtWebEngine
qt webengine
6 Posts 4 Posters 3.6k Views
  • 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.
  • P Offline
    P Offline
    pankaj4288
    wrote on 8 Jul 2015, 06:01 last edited by
    #1

    Hi,

    I am trying to develop an app for android/ios/windows for which I want UI to be in html/css.
    I tried using webkit, but I assume we can't use it anymore as it is deprecated and will be removed in future releases (moreover webkit was nit working on android mobile). So I used QTWebengine. Now my problem is when I try to communicate from my html to js it is fine, but from js to c++ is not working. Everywhere I am getting examples using webkit, but not with webengine. Can someone please help ?
    Also is it possible to create an app using html/css (and background in c++ communicating via js) to run fine on desktop and mobiles ??

    Thanks
    Pankaj Kushwaha

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Clem
      wrote on 8 Jul 2015, 07:39 last edited by
      #2

      @pankaj4288 said:

      my problem is when I try to communicate from my html to js it is fine, but from js to c++ is not working. Everywhere I am getting examples using webkit, but not with webengine. Can someone please help ?

      Hi Pankaj,

      From what I understood, you can have a look at QWebChannel standalone example given with Qt 5.5. It gets more complicated than with QtWebKit, and I was wondering if I were missing something or if it were supposed to change eventually, but I got no reply.

      Clem

      1 Reply Last reply
      0
      • P Offline
        P Offline
        pankaj4288
        wrote on 8 Jul 2015, 09:21 last edited by
        #3

        Thanks a lot..
        Yes the code is very complicated, and it seems that we are sending some data in json format from our C++ app to server and that is being displayed on browser. While I am looking for some example in which app's UI will be in html and all backend operations (like write/read database) will be in C++. These html will be rendered using QTWebengine, as QWebkit is deprecated.

        M 1 Reply Last reply 8 Jul 2015, 14:43
        0
        • P pankaj4288
          8 Jul 2015, 09:21

          Thanks a lot..
          Yes the code is very complicated, and it seems that we are sending some data in json format from our C++ app to server and that is being displayed on browser. While I am looking for some example in which app's UI will be in html and all backend operations (like write/read database) will be in C++. These html will be rendered using QTWebengine, as QWebkit is deprecated.

          M Offline
          M Offline
          maximus
          wrote on 8 Jul 2015, 14:43 last edited by maximus 7 Aug 2015, 14:47
          #4

          @pankaj4288

          Hopefully they make some more examples and improvement so that using QWebChannel becomes easy to use like with QWebkit (Qtwebkit-bridge). Sending object from C++ to JS and JS to C++ was easy with a simple line of code once you did "addToJavaScriptWindowObject".

          Now you have to include QWebChannel.js, and do a bunch of other steps. I wish all theses steps could be automated and done under the hood by Qt using some flag on the QWebEngineView for example.
          That and also QWebEngine is harder to deploy compared to QWebKit, the QWebEngineView is not present in designer..etc. all that makes me stick for QWebKit for now...


          Free Indoor Cycling Software - https://maximumtrainer.com

          P 1 Reply Last reply 10 Jul 2015, 06:06
          0
          • M maximus
            8 Jul 2015, 14:43

            @pankaj4288

            Hopefully they make some more examples and improvement so that using QWebChannel becomes easy to use like with QWebkit (Qtwebkit-bridge). Sending object from C++ to JS and JS to C++ was easy with a simple line of code once you did "addToJavaScriptWindowObject".

            Now you have to include QWebChannel.js, and do a bunch of other steps. I wish all theses steps could be automated and done under the hood by Qt using some flag on the QWebEngineView for example.
            That and also QWebEngine is harder to deploy compared to QWebKit, the QWebEngineView is not present in designer..etc. all that makes me stick for QWebKit for now...

            P Offline
            P Offline
            pankaj4288
            wrote on 10 Jul 2015, 06:06 last edited by
            #5

            @maximus
            I am able to use Qwebchannel in a single windows application, where windows loads my local html pages and via QwebChannel i send some data to my c++ code

            J 1 Reply Last reply 12 Nov 2015, 00:35
            0
            • P pankaj4288
              10 Jul 2015, 06:06

              @maximus
              I am able to use Qwebchannel in a single windows application, where windows loads my local html pages and via QwebChannel i send some data to my c++ code

              J Offline
              J Offline
              janalleman
              wrote on 12 Nov 2015, 00:35 last edited by
              #6

              @pankaj4288
              Can you send data from c++ object back to html/js? If so, do you have suggestion on what should be done different in my question here ... with that code I an unable to get variables in html/js.

              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