saadmd
saadmd

Reputation: 11

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 QWebPage.

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

Upvotes: 1

Views: 211

Answers (1)

alexisdm
alexisdm

Reputation: 29896

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.

Upvotes: 1

Related Questions