0

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.

Neox
  • 2,000
  • 13
  • 12

2 Answers2

1

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.

Kuba hasn't forgotten Monica
  • 95,931
  • 16
  • 151
  • 313
0

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.

Arnold Spence
  • 21,942
  • 7
  • 74
  • 67
  • The problem I am experiencing is following. I have Phonon::VideoWidget in one of the layouts in the MainWindow. Whenever the MainWindow is in fullscreen mode and the playback is stoped MainWindow exits fullscreen. I am puzzled because I am not doing anything to revert the MainWindow into NoState. Wonder if Phonon:VideoWidget has to do something with this? – Neox Sep 18 '11 at 07:53
  • I see. There isn't much documentation to be found regarding fullscreen mode for that widget. I get the impression it is a pretty minimally functional convenience feature and they mention that for more complex interactions you should manage a fullscreen implementation manually. – Arnold Spence Sep 18 '11 at 17:57