Hi,
My application has a QWorkspace, and I am adding to it a tab bar, to look like a QTabWidget. I am trying to detect when a window is closed, to update the window list. I am using this code:
connect( widget,
SIGNAL(destroyed
(QObject*)),
this,
SLOT(windowDeleted2
(QObject*)));
...
void qmdiWorkspace
::windowDeleted( QObject *o
) {
int windowNumber = workspace->windowList().lastIndexOf(dynamic_cast<QWidget*>(o));
if (windowNumber!=-1)
tabBar->removeTab( windowNumber );
}
connect( widget, SIGNAL(destroyed(QObject*)), this, SLOT(windowDeleted2(QObject*)));
...
void qmdiWorkspace::windowDeleted( QObject *o )
{
int windowNumber = workspace->windowList().lastIndexOf(dynamic_cast<QWidget*>(o));
if (windowNumber!=-1)
tabBar->removeTab( windowNumber );
}
To copy to clipboard, switch view to plain text mode
Now that function is never called. It seems that pressing the X on the windows, hides then and does not close them. Does anyone have an idea about a possible fix? another implementation of this feature?
I also read this thread, but I found no solution to my problem.
http://www.qtcentre.org/forum/f-qt-p...ssed-3144.html
Bookmarks