Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
6.7.3, 6.8.0, 6.8
-
None
Description
In a Qt widget-based application, there is a QPushButton that, when pressed, shows a Qt.labs.platform Menu within a QQuickWidget through signals and slots. After clicking any area to close the Menu, the QMainWindow still retains focus, meaning the QPushButton will trigger the Menu again just by moving the mouse over it, without needing to click again. Even using clearFocus, the issue persists. An additional click on the QMainWindow is required to restore normal behavior.
The issue does not occur when using the clicked signal, but due to my business requirements, the Menu must be triggered from the pressed signal.
After further investigation, I found that the issue was caused by another widget in my code that was calling winId. When I commented out the relevant code for obtaining winId, the issue was resolved. This makes me quite puzzled, as this is a minimal example (in the code, the widget named SideBar was obtaining the winId).