0

In QWindow there is a signal windowStateChanged(Qt::WindowState).

I'm looking for similar signal in QMainWindow. Is it available?

I need it to notify toolbar about fullscreen change, as I have a checkable toolbar button which changes window to fullscreen when user clicks it. However when user changes to fullscreen bypassing the button, it shows invalid state.

qiubit
  • 4,708
  • 6
  • 23
  • 37

1 Answers1

1

QMainWindow inherits from QWidget where you find the ::setWindowState(Qt::WindowStates) method. In its docs, it says:

When the window state changes, the widget receives a changeEvent() of type QEvent::WindowStateChange.

So it seems like you have to override changeEvent() to handle this, I don't think there is a signal.

Georg Schölly
  • 124,188
  • 49
  • 220
  • 267