Explorar o código

designer 传参

derrickx hai 1 ano
pai
achega
105ddbb378
Modificáronse 2 ficheiros con 7 adicións e 1 borrados
  1. 6 0
      dist/results/2024-05-27.txt
  2. 1 1
      main.py

+ 6 - 0
dist/results/2024-05-27.txt

@@ -0,0 +1,6 @@
+abcd, 你好abcd, 你好
+abcd, 你好
+abcd, 你好
+abcd, 你好
+abcd, 你好
+12

+ 1 - 1
main.py

@@ -138,7 +138,7 @@ class MainWindow(QMainWindow, Ui_menu):
         # 获取项目当前路径
         current_path = sys.path[0]
         # 拼接 txt 文件路径
-        file_path = f"{current_path}/results/2024-05-27.txt"
+        file_path = get_resource_path("results/2024-05-27.txt")
         try:
             QDesktopServices.openUrl(QUrl.fromLocalFile(file_path))
         except Exception as e: