Hi,

Indeed, Qt Assistant binaries currently use litehtml as renderer, and that 
doesn't support JavaScript. We had other renderers as compile-time switch in 
the past though, so it shouldn't be too much work to get something else 
working, like Qt WebEngine. Using Qt WebView would use the native renderer if 
available, but this would require likely some bigger refactoring, as you can't 
render content out of memory with this, AFAIK.

In terms of plans, there are no concrete plans for supporting JavaScript in Qt 
Assistant that I'm aware of. For Qt documentation, it seems litehtml is good 
enough, and switching to Qt WebEngine would only pay off if we could use it 
everywhere, including in Qt Creator. But loading Qt WebEngine for rendering a 
small documentation tooltip is again overkill, and negatively affects the 
performance of Qt Creator, especially at startup...

Kai

________________________________
From: Interest <interest-boun...@qt-project.org> on behalf of David C. 
Partridge <david.partri...@perdrix.co.uk>
Sent: Tuesday, March 11, 2025 9:42
To: interest@qt-project.org <interest@qt-project.org>
Subject: [Interest] Qt Assistant and javascript


I understand that Qt Assistant uses litehtml under the covers and that this 
means that it doesn’t support javascript.



This presents me with a bit of a problem because there a quite a few places in 
the html code for the help that use javascript like this:



    <A 
onmouseover="document['STACKRESULT01'].src='../images/Theory/Stack_1.jpg';;document.getElementById('LEGEND01').innerHTML='One
 Light Frame';" href="javascript:void(0);">

    1 image</A></b><br>

    <b>&nbsp;&nbsp;

    <A 
onmouseover="document['STACKRESULT01'].src='../images/Theory/Stack_2.jpg';document.getElementById('LEGEND01').innerHTML='Stack
 of 2 light frames';" href="javascript:void(0);">

    2 images</A></b><br>

    <b>&nbsp;&nbsp;

    <A 
onmouseover="document['STACKRESULT01'].src='../images/Theory/Stack_4.jpg';;document.getElementById('LEGEND01').innerHTML='Stack
 of 4 light frames';" href="javascript:void(0);">

    4 images</A></b><br>

    <b>&nbsp;&nbsp;

    <A 
onmouseover="document['STACKRESULT01'].src='../images/Theory/Stack_16.jpg';;document.getElementById('LEGEND01').innerHTML='Stack
 of 16 light frames';" href="javascript:void(0);">

    16 images</A></b><br>

    <b>&nbsp;&nbsp;

    <A 
onmouseover="document['STACKRESULT01'].src='../images/Theory/Stack_32.jpg';;document.getElementById('LEGEND01').innerHTML='Stack
 of 32 light frames';" href="javascript:void(0);">

    32 images</A></b></p>



To select which image to display based on which text the mouse is “over”.



Is there any hope for javascript support in the short term?



Alternatively, is there another way to achieve this function that Qt Assistant 
does support?

Is it likely that Qt Assistant might be changed to use QtWebEngine instead 
(which I think would provide javascript).



Thanks, David




_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

Reply via email to