开发者

why QWebFrame is not handled in the eventFilter Function?

I want to get the Mouse Position when clicked on a QWebFrame. I am using Event Filter function and that works fine with QWebView but it does not work either QWebFrame nor QWeb开发者_StackOverflow中文版Page.

Can any one please tell me how to make it work??? thanks in advance


As QWebFrame and QWebPage are not widgets, they don't officially receive mouse events.

And if you look at QWebView event functions, you'll see that the mouse events are sent to QWebPage with a direct call to QWebPage::event, they would need to be sent with QCoreApplication::postEvent or sendEvent to pass through the eventfilter.

If you want to filter these events, you'll have to derive QWebPage to redefine its event function. And no event is ever forwarded to QWebFrame.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜