Line data Source code
1 : # SPDX-FileCopyrightText: 2025 PairInteraction Developers 2 : # SPDX-License-Identifier: LGPL-3.0-or-later 3 : 4 : 5 1 : import sys 6 : 7 1 : from PySide6.QtCore import QTimer 8 : 9 1 : from pairinteraction_gui.app import Application, SplashScreen 10 : 11 1 : __all__ = ["main"] 12 : 13 : 14 1 : def main(*, enable_theme_hot_reload: bool = False) -> int: 15 : """Run the PairInteraction GUI application. 16 : 17 : Returns: 18 : int: Application exit code 19 : 20 : """ 21 0 : app = Application(sys.argv) 22 0 : app.setApplicationName("PairInteraction") 23 0 : app.allow_ctrl_c() 24 : 25 0 : splash = SplashScreen() 26 0 : splash.show() 27 0 : app.processEvents() 28 : 29 0 : def _start() -> None: 30 0 : from pairinteraction_gui.main_window import MainWindow 31 : 32 0 : window = MainWindow(enable_theme_hot_reload=enable_theme_hot_reload) 33 0 : window.show() 34 0 : splash.finish(window) 35 : 36 : # 50 ms lets the compositor flush the first frame, avoiding painting issues with the splash screen on some platforms 37 0 : QTimer.singleShot(50, _start) 38 : 39 0 : return app.exec()