Important: Please read the Qt Code of Conduct -

QWebFrame::hitTestContent imprecise

  • QWebFrame::hitTestContent is meant to give an element based on a coordinate.
    Considering this is HTML, there should never be a "" result ("BODY" or "HTML" are worst case scenarios), however that is specifically the behavior I'm seeing.
    Moreover, when it should be giving out "A", it might give out "SPAN" or "DIV".
    I wrote this "function": to try and do a depth-first search through all the frames, and the result was a segfault inside some of the QWebFrame::hitTestContent (of the latter ones).
    My question is, is there are more precise variant of QWebFrame::hitTestContent that will give the lowest-level tagname/element as a result (e.g. "A" even if it's in a span), and will never give out a null element (such as is often the case when clicking on text, for example)?

Log in to reply