I have an application with many windows (QWidgets).

Particularly, each of these windows is called here SubWindow. Every SubWindow class contains a layout with a MultiEditor *sEditors, which has a menu with an action that closes the current window. Every SubWindow is created within the MainWindow.

In the SubWindow constructor I have:

Qt Code:
  1. connect(sEditors, SIGNAL(closeWindow()), this, SLOT(close()));
  2. connect(this, SIGNAL(destroyed()), mainWindow, SLOT(closeWindow()));
To copy to clipboard, switch view to plain text mode 

The code actually works, as the slot closeWindow() is triggered. But the SubWindow doesn't disappear and remains visible.

Has anybody something to suggest me? I don't understand what actually the problem is (neither hide() seems to work).

Thanks!