I have reimplemented QWidget::event() handler, where I am handling windowStateChange event. I was wondering if there is any way to identify which widget sends this event.
How to identify QEvent sender
2.1k Views Asked by Neox At
2
There are 2 best solutions below
0
On
No, there's no way to do that, because posting or sending a QEvent does not require a QObject instance. When you post an event, it's done via a static QCoreApplication method, and it doesn't ask who's sending the event. Heck, it'd be counterproductive, because a useful way of interoperation between Qt and other event-driven code is to do event translation and post the events to the Qt side of things. The posting code may be an extern "C" function.
That event is generated when a window is minimized, maximized or full-screened so you should only see it from within the widget to which it applies.