elcuco
9th September 2006, 15:04
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 );
}
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-programming-2/t-how-to-hide-window-when-close-button-pressed-3144.html
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 );
}
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-programming-2/t-how-to-hide-window-when-close-button-pressed-3144.html