How to make QQuickView behave like a popup menu?
-
Using Qt 5.15, I'd like to create a QQuickView which behaves exactly like an application context menu. That is, it is modal, and automatically closes if the user clicks elsewhere.
I can set the Window flag Qt::Popup, and also set modality to Qt::ApplicationModal. The resulting window is top-level and modal, but it does not automatically close when clicking outside, as a popup menu should.
What am I missing?
-
Using Qt 5.15, I'd like to create a QQuickView which behaves exactly like an application context menu. That is, it is modal, and automatically closes if the user clicks elsewhere.
I can set the Window flag Qt::Popup, and also set modality to Qt::ApplicationModal. The resulting window is top-level and modal, but it does not automatically close when clicking outside, as a popup menu should.
What am I missing?
This doesn't seem to be implemented. Setting Qt::Popup doesn't work for QQuickView, and doesn't work for QQuickWidget, either.
A workaround is to use a plain QWidget as popup, and add a QQuickWidget as child.