Qt Assistant and mouseover
-
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 -
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.
-
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/ -
@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...