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.
{
if (!workspace)
return;
qmdiClient *client = dynamic_cast<qmdiClient*>(widget);
if (client)
client->mdiServer = this;
connect( widget,
SIGNAL(destroyed
(QObject*)),
this,
SLOT(windowDeleted
(QObject*)));
widget->setAttribute(Qt::WA_DeleteOnClose, true);
workspace->addWindow( widget );
tabBar->addTab( name );
widget->show();
}
void qmdiWorkspace::addTab( QWidget *widget, QString name )
{
if (!workspace)
return;
qmdiClient *client = dynamic_cast<qmdiClient*>(widget);
if (client)
client->mdiServer = this;
connect( widget, SIGNAL(destroyed(QObject*)), this, SLOT(windowDeleted(QObject*)));
widget->setAttribute(Qt::WA_DeleteOnClose, true);
workspace->addWindow( widget );
tabBar->addTab( name );
widget->show();
}
To copy to clipboard, switch view to plain text mode
Bookmarks