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



  • 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


  • Moderators

    @Discode
    see QtWebChannel module


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.