mirror of
https://github.com/bec-project/bec_widgets.git
synced 2026-11-18 15:24:18 +01:00
fix: prevent top-level dock areas to be destroyed with [X] button
This commit is contained in:
1 parent
5c83702382
commit
09cb08a233
2 files changed
+17
No files matched your search
@@ -249,6 +249,12 @@ def main():
|
||||
def sigint_handler(*args):
|
||||
# display message, for people to let it terminate gracefully
|
||||
print("Caught SIGINT, exiting")
|
||||
# first hide all top level windows
|
||||
# this is to discriminate the cases between "user clicks on [X]"
|
||||
# (which should be filtered, to not close -see BECDockArea-)
|
||||
# or "app is asked to close"
|
||||
for window in app.topLevelWidgets():
|
||||
window.hide() # so, we know we can exit because it is hidden
|
||||
app.quit()
|
||||
|
||||
signal.signal(signal.SIGINT, sigint_handler)
|
||||
|
||||
Reference in new issue
Block a user