0

I want to implement a code when QMdiarea is empty i.e. (has no QSubWindow children).

For example:

is there an event or signal which happens when the QMdiarea become empty?

Louis Langholtz
  • 2,913
  • 3
  • 17
  • 40
Lion King
  • 32,851
  • 25
  • 81
  • 143

1 Answers1

0

You can use QMdiArea::subWindowActivated(QMdiSubWindow *window) signal to track the mentioned state. As docs say, when window parameter is null means the last MDI child window is closed and the workspace is empty.

vahancho
  • 20,808
  • 3
  • 47
  • 55
  • This is false. As docs say, window parameter will be null when there's no active child window. You can call `QMdiArea.setActiveSubWindow(nullptr)` to have this signal emitted with nullptr window. – panda-34 Apr 23 '23 at 05:37