exception.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:smhr 作者: andycasey 项目源码 文件源码
def format(color, style=None):
    """
    Return a QTextCharFormat with the given attributes.

    :param color:
        The color to format the text.

    :param style: [optional]
        The styling for the text.

    """
    _color = QtGui.QColor()
    _color.setNamedColor(color)

    _format = QtGui.QTextCharFormat()
    _format.setForeground(_color)
    if style is not None and 'bold' in style:
        _format.setFontWeight(QtGui.QFont.Bold)
    if style is not None and 'italic' in style:
        _format.setFontItalic(True)

    return _format


# Syntax styles that can be shared by all languages
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号