mirror of
https://github.com/yuruotong1/autoMate.git
synced 2025-12-26 13:52:31 +08:00
22 lines
647 B
Python
22 lines
647 B
Python
import os
|
|
import sys
|
|
|
|
from PyQt6 import uic
|
|
|
|
|
|
class QtUtil:
|
|
@staticmethod
|
|
def load_ui(*path):
|
|
# 项目根目录
|
|
# project_root_path = os.path.abspath(os.path.dirname(__file__))
|
|
project_root_path = os.path.dirname(os.path.realpath(sys.argv[0]))
|
|
path = os.path.join(project_root_path, "pages", *path)
|
|
return uic.loadUi(path)
|
|
|
|
@staticmethod
|
|
def get_icon(*path):
|
|
project_root_path = os.path.dirname(os.path.realpath(sys.argv[0]))
|
|
# project_root_path = os.path.abspath(os.path.dirname(__file__))
|
|
path = os.path.join(project_root_path, "source", *path)
|
|
return path
|