Priority: P2: Important
Affects Version/s: 5.10.1
Fix Version/s: None
Component/s: Quick: Core Declarative QML
When creating a sub-window in Qt Quick with the Qt::Popup flag set, it does not close when the user clicks on a point outside the window.
An equivalent implementation in Qt Widgets works correctly - the popup behaves exactly like a typical right-click context menu and disappears if the user clicks on any point of the screen which is not in the popup, no matter if the click was in the parent window or in a different application or even the desktop.
Possibly, QQuickItem::grabMouse() is not called correctly?!
See the following code snippets to understand the issue (tested on Linux X11).
Qt Quick example:
The popup won't disappear if the user clicks outside it. A kind of workaround is to listen to the onActiveChanged event and close the popup if the window lost its active state. However, this covers only the case when the user clicks on a different window. If you click on the parent window, the popup won't close.
Qt Widgets example:
The popup is closed when the user clicks on any point of the screen which is not inside the popup (this is how it should be in Qt Quick as well).