new tool for quitting app from child windows
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user