Acces to HTML element in a WebEngineView



  • Hello all, i try to figure it out how works QML WebEngineView and how I can acces html element in it (read/write).
    The documentation is not clear for me, so here what I want to do.

    In a WebEngineView, I load an html page with only two INPUT elements in it, a "text" element and a "password" element.

    1. I want to show a QML keyboard of my own when a mouseclic event occur only in these two elements

    2. How can I automatic fill the values of these elements ?

    I guess runjavascript method is what I need but I don't understand how it could interact with my QML.



  • I tried this:

    var js="function testclic(){var index, inputs; inputs = document.getElementsByTagName('INPUT');\
                                                        for (index = 0; index < inputs.length; ++index)\
                                                        {\
                                                            inputs[index].onfocus = function()\
                                                            {\
                                                                return(33);\
                                                            }\
                                                        } return(-1);} testclic()"
     
     web_view.runJavaScript(js,function(result){console.log("res "+result);})
    

    but I never reach the onfocus...some advices ?


Log in to reply
 

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