# 需要导入模块: from PyQt5.QtWidgets import qApp [as 别名]# 或者: from PyQt5.QtWidgets.qApp importsetStyleSheet[as 别名]def__load_qss_style(path):"""Read and load the stylesheet file."""withopen(path, mode='r', encoding='utf-8')asf: style = f.read() qApp.setStyleSheet(style) ...
# 或者: from PyQt5.QtWidgets.qApp import setStyleSheet [as 别名] def loadQSS(theme) -> None: filename = ':/styles/{}.qss'.format(theme) if QFileInfo(filename).exists(): qssfile = QFile(filename) qssfile.open(QFile.ReadOnly | QFile.Text) content = QTextStream(qssfile).readAll(...