From the documentation of QWidgetAction
Note that it is up to the widget to activate the action, for example by reimplementing mouse event handlers and calling QAction::trigger().
Hence you might have to call trigger when Enter key is pressed on the line edit..