def load_style(self):
if cf.getint('BasicSetting', 'StyleLoad') == 1:
with open('./resources/style.qss', 'r') as qss_file: # 加载QSS文件
qApp.setStyleSheet(qss_file.read())
elif cf.getint('BasicSetting', 'StyleLoad') == 0:
with open('./resources/style_initial.qss', 'r') as qss_file: # 加载QSS文件
qApp.setStyleSheet(qss_file.read())
PyQt5中通过读取配置文件判断是否加载QSS样式文件
于 2024-04-15 23:04:24 首次发布