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. Call a C++ function from HTML in QWebEngineView, Is it Possible ?
Forum Updated to NodeBB v4.3 + New Features

Call a C++ function from HTML in QWebEngineView, Is it Possible ?

Scheduled Pinned Locked Moved Unsolved QtWebEngine
2 Posts 2 Posters 1.0k 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.
  • D Offline
    D Offline
    Discode
    wrote on last edited by
    #1

    Hello There
    I have a QWebEngineView to load a Web Page from local content.
    In that HTML page there is a Script include a variable "myVar", now i can get value of myVar but button click in C++,
    but my question is this:
    Is there any way to call a function in C++ whenever "myVar" changed ?
    something like this:

    <script>
            var myVar = null;
            function initVar(){
                   myVar = 'sample string';
                   // now call function ( funcInCpp(myVar);)
            }
    </script>
    

    Is there any way to do this ? if yes please help me
    Tnx

    raven-worxR 1 Reply Last reply
    0
    • D Discode

      Hello There
      I have a QWebEngineView to load a Web Page from local content.
      In that HTML page there is a Script include a variable "myVar", now i can get value of myVar but button click in C++,
      but my question is this:
      Is there any way to call a function in C++ whenever "myVar" changed ?
      something like this:

      <script>
              var myVar = null;
              function initVar(){
                     myVar = 'sample string';
                     // now call function ( funcInCpp(myVar);)
              }
      </script>
      

      Is there any way to do this ? if yes please help me
      Tnx

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @Discode
      see QtWebChannel module

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      3

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved