MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / closeEvent

Method closeEvent

pcsx2-qt/MainWindow.cpp:2525–2549  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2523}
2524
2525void MainWindow::closeEvent(QCloseEvent* event)
2526{
2527 // If there's no VM, we can just exit as normal.
2528 if (!s_vm_valid || !m_display_created)
2529 {
2530 m_is_closing = true;
2531 saveStateToConfig();
2532 if (m_display_created)
2533 g_emu_thread->stopFullscreenUI();
2534 destroySubWindows();
2535 QMainWindow::closeEvent(event);
2536 return;
2537 }
2538
2539 // But if there is, we have to cancel the action, regardless of whether we ended exiting
2540 // or not. The window still needs to be visible while GS is shutting down.
2541 event->ignore();
2542
2543 // Exit cancelled?
2544 if (!requestShutdown(true, true, EmuConfig.SaveStateOnShutdown))
2545 return;
2546
2547 // Application will be exited in VM stopped handler.
2548 m_is_closing = true;
2549}
2550
2551void MainWindow::changeEvent(QEvent* event)
2552{

Callers

nothing calls this directly

Calls 1

stopFullscreenUIMethod · 0.80

Tested by

no test coverage detected