new tool for quitting app from child windows

This commit is contained in:
2026-03-19 14:22:54 +01:00
parent 720b004eca
commit 945abae5f1
5 changed files with 31 additions and 5 deletions

View File

@@ -1,5 +1,6 @@
import sys
from pathlib import Path
from PySide6.QtWidgets import QApplication
PROJECT_ROOT = Path(__file__).resolve().parents[2]
@@ -17,3 +18,10 @@ def get_executable_dir() -> Path:
# sys.executable est le chemin complet vers l'application .exe
return Path(sys.executable).parent.resolve()
return Path(__file__).resolve().parents[2]
def quit_application(exit_code: int = 0) -> None:
app = QApplication.instance()
if app is not None:
app.closeAllWindows()
app.exit(exit_code)
sys.exit(exit_code)