| 150 | } |
| 151 | |
| 152 | QWidget* ShutdownWindow::showShutdownWindow(QMainWindow* window) |
| 153 | { |
| 154 | assert(window != nullptr); |
| 155 | |
| 156 | // Show a simple window indicating shutdown status |
| 157 | QWidget *shutdownWindow = new ShutdownWindow(); |
| 158 | shutdownWindow->setWindowTitle(window->windowTitle()); |
| 159 | |
| 160 | // Center shutdown window at where main window was |
| 161 | const QPoint global = window->mapToGlobal(window->rect().center()); |
| 162 | shutdownWindow->move(global.x() - shutdownWindow->width() / 2, global.y() - shutdownWindow->height() / 2); |
| 163 | shutdownWindow->show(); |
| 164 | return shutdownWindow; |
| 165 | } |
| 166 | |
| 167 | void ShutdownWindow::closeEvent(QCloseEvent *event) |
| 168 | { |