Let Qt keep track of top-level windows.
This commit is contained in:
+5
-2
@@ -204,8 +204,11 @@ void File::close( MainWindow *window )
|
||||
///
|
||||
void File::exit()
|
||||
{
|
||||
foreach ( MainWindow* window, MainWindow::windowList() )
|
||||
foreach ( QWidget* qwidget, QApplication::topLevelWidgets() )
|
||||
{
|
||||
window->close();
|
||||
if ( MainWindow* window = qobject_cast<MainWindow*>(qwidget) )
|
||||
{
|
||||
window->close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user