qt5.Webview component - how to replicate qt5.WebKit.HitTest method

Post your Gambas programming questions here.
Post Reply
ask4nix
Posts: 7
Joined: Thursday 3rd August 2023 3:24pm

qt5.Webview component - how to replicate qt5.WebKit.HitTest method

Post by ask4nix »

I do most of my coding in Debian 12 with the KDE Plasma desktop and use the Gambas qt5 toolkit. I have 2 apps where I use the qt5.Webkit component, specifically the Webview in that component, as an HTML editor. And I use the Webview.HitTest method to test whether I am clicking on an image, a link, or text in the Webview. But the qt5.Webkit looks like it is being phased out - it seems not to be included in the default Debian Gambas3 install (although it's still available in the respositories), and I can no longer find it at all in the Arch or AUR repositories, so my apps won't run on Arch-based distros). Instead it has been replaced by the newer gb.qt5.Webview component, which unfortunately doesn't seem to provide a HitTest method. I would be grateful for any advice on how retrieve information on what kind of object (image, link or text) I have selected when I click on something inside the Webview element in the qt5.Webview component. In other words, if I click inside the Webview element of the gb.qt5.Webview, how can I replicate the behaviour of WebView.HitTest in the older qt5.Webkit component?
Thank you
ask4nix
Posts: 7
Joined: Thursday 3rd August 2023 3:24pm

Re: qt5.Webview component - how to replicate qt5.WebKit.HitTest method

Post by ask4nix »

Some further thoughts on this. I'm not even sure if there are other Gambas3 controls that offer the same functionality as gb.qt5.Webkit for editing html content, so my original question might not be relevant. I did re-check the Arch AUR and found build scripts for qt5.Webkit there, but on second thoughts it is highly likely that gb.qt5.Webkit is optimised for Gambas and the AUR build would not work anyway. So I guess I will just stick with Debian and maybe build an AppImage following the guidelines in https://forum.gambas.one/viewtopic.php?t=821 if I want to support other distros.
Post Reply