QML scene displayed with QQuickWidget doesn't get QHoverEvent when cursor leaves the widget.
In the example below the QML rectangle supposed to become red when cursor enters rectangle, and green when it leaves. It doesn't happen when the scene is displayed with QQuickWidget, though it works as intended when the scene is displayed with QWidget::createWindowContainer(...).
=== Example.qml ===
=== main.cpp ===
My current workaround, without touching Qt source code, is to install event filter on QQuickWidget, intercept events with type QEvent::Leave and, once caught, manually send QMouseMove event with QEvent::MouseMove type and ( – 1, – 1) coordinate to the off-screen window of the widget (that I get as widget->rootItem()->window()).
|For Gerrit Dashboard: QTBUG-45557|
|111733,2||Pass enter and leave events to the offscreen window.||5.5||qt/qtdeclarative||Status: ABANDONED||+2||0|
|142748,12||QQuickWidget: pass enter and leave events to the offscreen window||5.9||qt/qtdeclarative||Status: MERGED||+2||0|