I want to rewrite a Qt application in HTML and provide QtWebEngine for rendering it. I fully understand that the HTML page will be displayed and run in QtWebEngine.
However, Iβm very interested, and I canβt find the documentation - apologies if I look in the wrong place - to know if QtWebEngine allows DOM elements to be "replaced" with native Qt widgets. For example, can <div id="myWidget"> be a QOpenGLWidget? Is this completely pointless?
For example, I would like to be able to:
<body> <h1>Example</h1> <div id="myWidget"> </div> <p>Some text</p> </body>
and magically, so that my QOpenGLWidget appears in the DOM instead of "myWidget". My HTML code could only be displayed by QtWebEngine, not necessarily by other browsers, so if there is a solution that means it will not work in Chrome / Firefox / IE, this is absolutely normal with me.
... Or will I need to use javascript running in a QtWebEngine instance to find out the position of "myWidget" and how to draw the QOpenGLWidget pixel data at that position? I really do not want to go this way, because it does not allow you to use things like HTML dialogs at the top of "myWidget".
I would really appreciate any information here. An example (if possible) would be fantastic. Thank you very much in advance.
source share