Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fire user-like event in QWebElement

Is it real to fire user-like events (like mouse click on link) for QWebElement? I.e., for instance, given QWebElement from current frame (using QWebKit) for html tag ("") I want programmatically click() this element.

In more complicated situations, there are more interestings things, like How to emit OnChange event for html UL element? In this case, I not only emit OnChange(), but also set new element from enumeration in role Current Element (in user-like behavior, there are two steps: 1. Click on UL (after this box with elements expanded) 2. Select some element)

I already solve this problem for elements with manually (by site-developer programmers) wroted attributes like onclick=..., onchange=..., etc by using jQuery in real-time and its function trigger(...).

But, problem with programmatically fire user-like events is big for me, pleast help)

like image 752
Jamon Avatar asked Feb 17 '10 11:02

Jamon


1 Answers

Try the evaluateJavaScript method from http://qt.nokia.com/doc/4.6-snapshot/qwebelement.html#evaluateJavaScript

like image 98
Raindog Avatar answered Oct 31 '22 17:10

Raindog