Qt Assistant and mouseover
-
wrote on 9 Mar 2025, 01:25 last edited by
Does Qt Assistant support html like:
You can see an example of a star mask on the right.<br> Mouse over the text to see <b><A onmouseover="document['STARMASK01'].src='../images/StarMask_Stars.jpg';document.getElementById('STARMASK01TEXT').innerHTML='Star Field';" href="javascript:void(0);"> the image</A></b> or <b><A onmouseover="document['STARMASK01'].src='../images/StarMask_Mask.jpg';document.getElementById('STARMASK01TEXT').innerHTML='Star Mask';" href="javascript:void(0);">the star mask</A></b>
to select different images for display based on mouse location?
Thanks
David -
wrote on 9 Mar 2025, 02:18 last edited by
It looks like Assistant's display is implemented via QTextBrowser, which makes no mention of javascript or QJSEngine in the documentation. As such, embedded javascript won't work.
An application could use QTextBrowser::highlighted() to detect the mouseover and alter the underlying document as desired.
-
wrote on 9 Mar 2025, 09:24 last edited by
Well that's a great shame, as the help for my application is Windows .chm format, and it makes quite a bit of use of mouseover.
-
wrote on 9 Mar 2025, 12:26 last edited by Perdrix 3 Sept 2025, 12:43
Is anyone able to provide a definitive answer? I think QtWebKit does support javascript, and the file that I was pointed to seems to suggest the Assistant might use that ...
Thanks, David
-
I know it's hard for a programmer but simply look at the code...
https://code.qt.io/cgit/qt/qttools.git/tree/src/assistant/CMakeLists.txt
It does not link against QtWebKit (which would be very surprising as this is dead since ages) but qlighthtml which is a wrapper around http://www.litehtml.com/ -
I know it's hard for a programmer but simply look at the code...
https://code.qt.io/cgit/qt/qttools.git/tree/src/assistant/CMakeLists.txt
It does not link against QtWebKit (which would be very surprising as this is dead since ages) but qlighthtml which is a wrapper around http://www.litehtml.com/wrote on 9 Mar 2025, 14:07 last edited by@Christian-Ehrlicher said in Qt Assistant and mouseover:
I know it's hard for a programmer but simply look at the code...
https://code.qt.io/cgit/qt/qttools.git/tree/src/assistant/CMakeLists.txt
It does not link against QtWebKit (which would be very surprising as this is dead since ages) but qlighthtml which is a wrapper around http://www.litehtml.com/If it was possible, I would downvote such a post that doesn't give any definitive nor at least helpful answer but a very subjective sarcastic view.
-
Now tell me what's wrong with my answer?
No, Qt Assistant does not use QtWebkit which was deprecated already 6 years ago, it uses litehtml. The features of litehtml are shown on http://www.litehtml.com/ - if you find something about javascript events there, let me know.
And if you don't trust the sources, simply try it out. You would have known it already then... -
wrote on 9 Mar 2025, 17:05 last edited by
In answer to the question - there's only so many hours in the day - often it is just quicker to ask than to to go digging in the source code (or to set up a test case).
-
wrote on 10 Mar 2025, 17:07 last edited by
Now if QTextBrowser were based on QtWebEngine (well I can dream can't I).
-
1/9