I followed your advice, and this is the code I ended with. Still, when I click the X on the windows, the signal is still not emmited.

Qt Code:
  1. void qmdiWorkspace::addTab( QWidget *widget, QString name )
  2. {
  3. if (!workspace)
  4. return;
  5.  
  6. qmdiClient *client = dynamic_cast<qmdiClient*>(widget);
  7. if (client)
  8. client->mdiServer = this;
  9.  
  10. connect( widget, SIGNAL(destroyed(QObject*)), this, SLOT(windowDeleted(QObject*)));
  11. widget->setAttribute(Qt::WA_DeleteOnClose, true);
  12. workspace->addWindow( widget );
  13. tabBar->addTab( name );
  14. widget->show();
  15. }
To copy to clipboard, switch view to plain text mode