QWidgetAction: how to make the menu disappear after the user completes the input

In my QMenuBar, I have several menus.

One of these menus has a QWidgetAction.

This is clearly visible, but the problem is that as soon as the user completes the input, I want the menu to disappear (like the usual behavior for classic QAction).

However, I am not sure how to do this. In my QWidgetAction there is a button that the user clicks when he is done; Therefore, I can bind to this pressed button ().

In the slot, I tried to set the Focus () element outside the menu, but the menu still does not disappear.

How do I tell the menu to close itself when my users complete their interaction with QWidgetAction?

thank

+3
source share
1 answer

QMenu QWidget, yourmenu- > hide() .

, .

+3

All Articles