I am using a QMenu in my application and when I click outside the QMenu to close it, Qt emits a couple of events. I found that on Linux, it emits the following events:
QEvent::MouseButtonPress
QEvent::Close
QEvent::Hide
QEvent::HideToParent
QEvent::UpdateRequest
QEvent::Leave
on Mac OS, the events emitted are as follows:
QEvent::Close
QEvent::Hide
QEvent::HideToParent
QEvent::UpdateRequest
QEvent::Leave
As it is visible that when QMenu is closed, the QEvent::MouseButtonPress is not emitted on Mac environment. I want to know if it is a bug in Qt or it is an intentional behavior.
In my code, I am calculating the coordinates of mouse click when QMenu is closed, in mousePressEvent() method, which I have overriden in my custom menu class which inherits QMenu. But it is breaking the whole application on Mac OS due to the reason highlighted above.
I am using Qt version 5.12.3