mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-02 14:51:15 +00:00
Fix sixtyfps::quit_event_loop()
not exiting the event loop with Qt 6 on macOS
As per commit 0c02f133f3daee146b805149e69bba8cee6727b2 in qtbase (qt6), quit() on QCoreApplication on macOS calls [NSApp terminate], which will not return to main. The latter however is documented behavior, and sixtyfps-viewer for example relies on it.
This commit is contained in:
parent
f0f264a94a
commit
e305f0e61c
1 changed files with 5 additions and 1 deletions
|
@ -150,7 +150,11 @@ impl sixtyfps_corelib::backend::Backend for Backend {
|
|||
{
|
||||
use cpp::cpp;
|
||||
cpp! {unsafe [] {
|
||||
qApp->quit();
|
||||
// Use a quit event to avoid qApp->quit() calling
|
||||
// [NSApp terminate:nil] and us never returning from the
|
||||
// event loop - sixtyfps-viewer relies on the ability to
|
||||
// return from run().
|
||||
QCoreApplication::postEvent(qApp, new QEvent(QEvent::Quit));
|
||||
} }
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue