Add new PyQt UI
This commit is contained in:
32
laser_control/gui/main.py
Normal file
32
laser_control/gui/main.py
Normal file
@ -0,0 +1,32 @@
|
||||
"""Application entry point for the PyQt-based laser-control GUI."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
from PyQt6.QtWidgets import QApplication
|
||||
import pyqtgraph as pg
|
||||
|
||||
from .theme import apply_theme
|
||||
from .window import MainWindow
|
||||
|
||||
|
||||
def main() -> int:
|
||||
"""Run the GUI event loop."""
|
||||
os.environ.setdefault("PYQTGRAPH_QT_LIB", "PyQt6")
|
||||
|
||||
app = QApplication(sys.argv)
|
||||
pg.setConfigOptions(antialias=True, background="#0f1720", foreground="#dce6f2")
|
||||
apply_theme(app)
|
||||
|
||||
window = MainWindow(auto_connect=True)
|
||||
screen = app.primaryScreen()
|
||||
if screen is not None:
|
||||
window.setGeometry(screen.availableGeometry())
|
||||
window.show()
|
||||
return app.exec()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
Reference in New Issue
Block a user