Let Qt keep track of top-level windows.

This commit is contained in:
Jim Evins
2016-05-15 16:33:02 -04:00
parent 1819a02d50
commit f920965668
3 changed files with 5 additions and 23 deletions
+5 -2
View File
@@ -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();
}
}
}