Example #1
0
def _(setting_dict):
    """
    Used for QAbstractItemModel data method for Qt.FontRole
    :param setting_dict: user input
    :return: a QFont instance with given style
    """
    _font = QFont()
    _font.setUnderline(setting_dict.get('underline') or False)
    _font.setBold(setting_dict.get('bold') or False)
    _font.setItalic(setting_dict.get('italic') or False)
    return _font
Example #2
0
def font_formatter(setting_dict):
    """
    Used for QAbstractItemModel data method for Qt.FontRole
    :param underline: font style underline
    :param bold: font style bold
    :return: a QFont instance with given style
    """
    _font = QFont()
    _font.setUnderline(setting_dict.get('underline') or False)
    _font.setBold(setting_dict.get('bold') or False)
    return _font
Example #3
0
def font_formatter(underline=False, bold=False):
    """
    Used for QAbstractItemModel data method for Qt.FontRole
    :param underline: font style underline
    :param bold: font style bold
    :return: a QFont instance with given style
    """
    _font = QFont()
    _font.setUnderline(underline)
    _font.setBold(bold)
    return _font