Hello. I have a simple browser based on QWebView/QWebPage. I would like my user to be able to ask for special treatment by right-clicking (control-clicking) a link. Or maybe shift-clicking, anyway a special click to request special linkage.
When the link is clicked normally, the WebPage should handle the link in the usual way. I want to offer special handling only when the link is differently-clicked (specifically, I would open the link in the system default browser instead of mine).
I can see two approaches: one, set the link delegation policy to delegate all links, this gives me a signal linkClicked(URL). However I do not see, in the handler for this signal, any way to distinguish the type of click that caused the signal.
Or, I could override createStandardContextMenu() and provide a menu with my action in it. This would be called on any right/control-click, but then: how do I know what link the mouse is on, or indeed, was it clicked on a link at all?
Any suggestions or different ideas most welcome.
↧