Heads-up for anyone reading this. I have come across this topic in trying to solve my new post at https://forum.qt.io/topic/112224/signal-slot-vs-direct-call-and-related-question, where I need to know which window/widget has the focus when a (main window) menu is invoked.
The OP (@Elsworth55 )'s question here seems "alarmist"! Of course we need Qt to tell us which widget is focussed when a menu is invoked, else we're in trouble! Maybe it never got an answer because I do not find the behaviour reported by the OP here.
Tested under Qt 5.12.2, Linux. I find that QApplication.focusWidget() does return the correct, currently-focussed widget. I have tested this on both a generic QWidget and a QLineEdit, and I have tested both when the menu is pulled down (QMenu::aboutToShow()) and when a item is clicked (QAction::triggered). In all cases I found it worked, so I don';t know about this OP's
the QLineEdit that was previously in focus will get focus restored after clicking the menu item
but when you click on a menu item it gives focus to the menu, so the focusWidget() will be the menu