def getFormat(self, tag: ContentTagsEnum) -> QtGui.QTextCharFormat:
if tag not in self._colors:
return None
fg, bg = self._colors[tag]
f = QtGui.QTextCharFormat()
f.setForeground(fg)
f.setBackground(bg)
f.setProperty(VivTextProperties.vivTag, tag)
return f
评论列表
文章目录