原文:https://stackoverflow.com/questions/30566101/how-can-i-get-paint-events-with-qtwebengine
经过验证 在我使用Qt 5.13.0 MSVC2017_32bit 的编译环境下,下面方法有用。关键在于QEvent::ChildPolished事件,对QtWebEngineCore::RenderWidgetHostViewQtDelegateWidget 进行事件过滤器就可以获取到鼠标事件了。
以下获取的是QEvent::ChildAdded事件,但是设置installEventFilter无效,原因应该是会有QEvent::ChildRemoved事件触发导致的。