如何在 QWebElement 中触发类似用户的事件
为 QWebElement 触发类似用户的事件(例如鼠标单击链接)是真的吗? 即,例如,给定当前框架中的 QWebElement(使用 QWebKit)作为 html 标签(“”),我想以编程方式单击()此元素。
在更复杂的情况下,还有更有趣的事情,例如如何为 html UL 元素发出 OnChange 事件?在这种情况下,我不仅发出 OnChange(),而且还从角色 Current Element 中的枚举设置新元素 (在类似用户的行为中,有两个步骤: 1. 单击 UL(在此框后面,元素展开) 2.选择一些元素)
我已经通过实时使用 jQuery 及其函数触发器解决了手动(由站点开发程序员)编写属性(如 onclick=...、onchange=... 等)的元素的问题( ...)。
但是,以编程方式触发类似用户的事件的问题对我来说很大,请帮助)
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)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试 http://qt.nokia.com/doc 中的valuateJavaScript方法/4.6-snapshot/qwebelement.html#evaluateJavaScript
Try the evaluateJavaScript method from http://qt.nokia.com/doc/4.6-snapshot/qwebelement.html#evaluateJavaScript