|
|
@@ -1,16 +1,23 @@
|
|
|
import sys
|
|
|
+import os
|
|
|
from PyQt6.QtWidgets import QApplication
|
|
|
from ui.main_window import MainWindow
|
|
|
|
|
|
+def get_resource_path(relative_path):
|
|
|
+ if hasattr(sys, '_MEIPASS'):
|
|
|
+ return os.path.join(sys._MEIPASS, relative_path)
|
|
|
+ return os.path.join(os.path.abspath("."), relative_path)
|
|
|
+
|
|
|
def main():
|
|
|
app = QApplication(sys.argv)
|
|
|
|
|
|
# Load stylesheet
|
|
|
+ style_path = get_resource_path(os.path.join("resources", "style.qss"))
|
|
|
try:
|
|
|
- with open("resources/style.qss", "r") as f:
|
|
|
+ with open(style_path, "r") as f:
|
|
|
app.setStyleSheet(f.read())
|
|
|
except FileNotFoundError:
|
|
|
- print("Warning: style.qss not found, using default styling.")
|
|
|
+ print(f"Warning: style.qss not found at {style_path}, using default styling.")
|
|
|
|
|
|
window = MainWindow()
|
|
|
window.show()
|