main.py 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. """
  2. DuDONG Application Entry Point
  3. Main entry point for the DuDONG Grading System application.
  4. Initializes the Qt application and displays the main window.
  5. """
  6. import sys
  7. from PyQt5.QtWidgets import QApplication
  8. from PyQt5.QtGui import QIcon
  9. from pathlib import Path
  10. from ui.main_window import DuDONGMainWindow
  11. def main():
  12. """
  13. Main application entry point.
  14. Initializes QApplication, creates and shows the main window,
  15. and starts the event loop.
  16. """
  17. # Create Qt application
  18. app = QApplication(sys.argv)
  19. # Set application metadata
  20. app.setApplicationName("DuDONG")
  21. app.setOrganizationName("AIDurian")
  22. app.setOrganizationDomain("aidurian.org")
  23. # Set application icon (if exists)
  24. icon_path = Path(__file__).parent / "assets" / "logos" / "durian.png"
  25. if icon_path.exists():
  26. app.setWindowIcon(QIcon(str(icon_path)))
  27. # Set application-wide style
  28. app.setStyleSheet("""
  29. QApplication {
  30. font-family: Arial, sans-serif;
  31. }
  32. """)
  33. # Create and show main window
  34. print("=" * 80)
  35. print("DuDONG Grading System")
  36. print("=" * 80)
  37. print("Initializing application...")
  38. window = DuDONGMainWindow()
  39. window.show()
  40. print("Application started successfully!")
  41. print("=" * 80)
  42. # Start event loop
  43. sys.exit(app.exec_())
  44. if __name__ == "__main__":
  45. main()