[Qt-interest] how to get element clicked by mouse in qt webkit?
Girish Ramakrishnan
girish at forwardbias.in
Fri Nov 19 17:50:09 CET 2010
With the mouse clicked position, call
http://doc.qt.nokia.com/4.7/qwebframe.html#hitTestContent. The
returned QWebHitTestResult will contain the underlying DOM element
(QWebElement).
Girish
On Fri, Nov 19, 2010 at 5:05 PM, Li Li <fancyerii at gmail.com> wrote:
> hi
> I want to interact with user in qt webkit. If user click on a
> element such as a <div>, I need to know that this div is clicked.
> I searched the web and found 2 solutions
> 1, use javascript. when page loaded, assign an unique id for every
> element and and onclicked js events for it
> 2, use mouse clicked position. recursively travese the dom tree and
> find which element contains this point
> method 1 need deal with javascript and method 2 seems not very efficenint.
> Is there any API providing any quick solution?
> Thanks.
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
More information about the Qt-interest-old
mailing list