def theme_menu(self):
actions = self.menuTheme.actions()
for i in actions[2:]:
self.menuTheme.removeAction(i)
path = os.path.join(os.path.dirname(__file__), 'colors').replace('\\','/')
files = glob.glob1(path, '*.json')
for f in files:
full = os.path.join(path, f).replace('\\','/')
d = json.load(open(full))
a = QAction(d['name'], self, triggered=lambda f=d['name']:self.set_theme(f))
self.menuTheme.addAction(a)
评论列表
文章目录